Questions tagged [standard-error]

The standard error is the standard deviation of the sampling distribution of a statistic. The term may also be used to refer to an estimate of that standard deviation, derived from a particular sample used to compute the estimate

The standard error of the mean (i.e., of using the sample mean as a method of estimating the population mean) is the standard deviation of those sample means over all possible samples (of a given size) drawn from the population. Secondly, the standard error of the mean can refer to an estimate of that standard deviation, computed from the sample of data being analyzed at the time.

In regression analysis, the term standard error is also used in the phrase standard error of the regression to mean the ordinary least squares estimate of the standard deviation of the underlying errors.

295 questions
103
votes
8 answers

How to find the standard error of the mean?

Is there any command to find the standard error of the mean in R?
alex
  • 1,213
  • 2
  • 11
  • 9
33
votes
5 answers

Extract standard errors from lm object

We got a lm object from and want to extract the standard error lm_aaa <- lm(aaa ~ x + y + z) I know the function summary, names and coefficients. However, summary seems to be the only way to manually access the standard error. Have you any idea how…
Fabian Stolz
  • 1,935
  • 7
  • 27
  • 30
21
votes
3 answers

Extract standard errors from glm

I did a glm and I just want to extract the standard errors of each coefficient. I saw on the internet the function se.coef() but it doesn't work, it returns "Error: could not find function "se.coef"".
user1096592
  • 227
  • 1
  • 2
  • 3
20
votes
2 answers

Newey-West standard errors with Mean Groups/Fama-MacBeth estimator

I'm trying to get Newey-West standard errors to work with the output of pmg() (Mean Groups/Fama-MacBeth estimator) from the plm package. Following the example from here: require(foreign) require(plm) require(lmtest) test <-…
cocquemas
  • 1,149
  • 8
  • 17
18
votes
2 answers

Heteroscedasticity robust standard errors with the PLM package

I am trying to learn R after using Stata and I must say that I love it. But now I am having some trouble. I am about to do some multiple regressions with Panel Data so I am using the plm package. Now I want to have the same results with plm in R as…
Marcus R
  • 245
  • 1
  • 2
  • 8
16
votes
1 answer

Different Robust Standard Errors of Logit Regression in Stata and R

I am trying to replicate a logit regression from Stata to R. In Stata I use the option "robust" to have the robust standard error (heteroscedasticity-consistent standard error). I am able to replicate the exactly same coefficients from Stata, but I…
chl111
  • 468
  • 3
  • 14
13
votes
4 answers

Double clustered standard errors for panel data

I have a panel data set in R (time and cross section) and would like to compute standard errors that are clustered by two dimensions, because my residuals are correlated both ways. Googling around I found…
Alex
  • 19,533
  • 37
  • 126
  • 195
13
votes
2 answers

Cluster-Robust Standard Errors in Stargazer

Does anyone know how to get stargazer to display clustered SEs for lm models? (And the corresponding F-test?) If possible, I'd like to follow an approach similar to computing heteroskedasticity-robust SEs with sandwich and popping them into…
RSS
  • 163
  • 1
  • 2
  • 11
10
votes
1 answer

first-difference linear panel model variance in R and Stata

I would like for a colleague to replicate a first-difference linear panel data model that I am estimating with Stata with the plm package in R (or some other package). In Stata, xtreg does not have a first difference option, so instead I run: reg…
dimitriy
  • 9,077
  • 2
  • 25
  • 50
8
votes
1 answer

Heckman selection model in R manually

I would like to calculate a Heckman selection model manually in R. My problem is that the standard errors are biased. Is there a way to correct these manually as well? Below my (sample) code from the sampleSelection model (correct SEs), and the…
research111
  • 347
  • 5
  • 18
8
votes
2 answers

Clustered standard errors in R using plm (with fixed effects)

I'm trying to run a regression in R's plm package with fixed effects and model = 'within', while having clustered standard errors. Using the Cigar dataset from plm, I'm running: require(plm) require(lmtest) data(Cigar) model <- plm(price ~ sales +…
user5450835
  • 83
  • 1
  • 1
  • 3
8
votes
3 answers

R calculate the standard error using bootstrap

I have this array of values: > df [1] 2 0 0 2 2 0 0 1 0 1 2 1 0 1 3 0 0 1 1 0 0 0 2 1 2 1 3 1 0 0 0 1 1 2 0 1 3 [38] 1 0 2 1 1 2 2 1 2 2 2 1 1 1 2 1 0 0 0 0 0 0 0 0 0 0 1 0 1 1 0 1 0 0 0 0 0 [75] 0 0 0 0 0 1 1 0 1 1 1 1 3 1 3 0 1 2 2 1 2 3 1 0 0…
Vahid Mirjalili
  • 6,211
  • 15
  • 57
  • 80
7
votes
2 answers

Problem placing error bars at the center of the columns in ggplot()

I am having a problem with my bar chart- the error bars just appear on the corner of the columns of the grouping variable rather than on them in a centralised way. The code I am using is this: a <- data.frame (Cond = c("In", "In", "Out", "Out"), …
Bahar
  • 71
  • 1
  • 1
  • 3
7
votes
2 answers

Clustered Standard Errors with data containing NAs

I'm unable to cluster standard errors using R and guidance based on this post. The cl function returns the error: Error in tapply(x, cluster1, sum) : arguments must have same length After reading up on tapply I'm still not sure why my cluster…
goldisfine
  • 4,742
  • 11
  • 59
  • 83
6
votes
5 answers

How to disable std::cerr?

I got a program which contains a lot of std::cerr, it directly outputs to my terminal. I am wondering what is the difference between std::cerr and std::cout. And how can I disable the std::cerr (I don't want it output to my screen)?
Joe SHI
  • 1,734
  • 4
  • 20
  • 39
1
2 3
19 20