extracting standard errors (se) from $output

4 replies [Last post]
tbates's picture
Offline
Joined: 07/31/2009

Hi there,
I can't see the SEs in $output... I guess that means they are computed by summary()?
But I also don't see how to extract them programatically from the output of summary(fit)

none of these work:
x = summary(fit)
x$SE; x$standard_error; x$error_estimate

any clues?

tbates's picture
Offline
Joined: 07/31/2009
answering own

answering own question:

summary(fit)->x
x$parameters->y
names(y)
y$"error estimate"

y$"parameter estimate"

CI95 = y$"error estimate" *1.96
out = data.frame(cbind(y$"parameter estimate" - CI95,y$"parameter estimate" + CI95))
names(out)<-c("lower95", "upper95")
cbind(y,out)

         name    matrix row col parameter estimate error estimate    lower95   upper95
1        <NA>       z.a   1   1         0.70073451     0.02057023 0.66041686 0.7410522
2        <NA>       z.a   2   1         0.24912664     0.02591953 0.19832436 0.2999289
3        <NA>       z.a   3   1         0.20698145     0.02510899 0.15776784 0.2561951
4        <NA>       z.a   2   2         0.51334363     0.02391689 0.46646651 0.5602207
5        <NA>       z.a   3   2         0.14779040     0.03128508 0.08647163 0.2091092
6        <NA>       z.a   3   3         0.46045070     0.02237860 0.41658864 0.5043128
7        <NA>       z.e   1   1         0.56046335     0.01486462 0.53132870 0.5895980
8        <NA>       z.e   2   1         0.09410643     0.02322942 0.04857677 0.1396361
9        <NA>       z.e   3   1         0.15132024     0.02320856 0.10583146 0.1968090
10       <NA>       z.e   2   2         0.57513631     0.01714868 0.54152490 0.6087477
11       <NA>       z.e   3   2         0.23929379     0.02285542 0.19449718 0.2840904
12       <NA>       z.e   3   3         0.57438104     0.01486940 0.54523701 0.6035251
13 Trait1mean z.expMean   1   1         2.49599883     0.02137079 2.45411208 2.5378856
14 Trait2mean z.expMean   1   2         2.97599306     0.01945248 2.93786620 3.0141199
15 Trait3mean z.expMean   1   3         2.08150033     0.01837959 2.04547632 2.1175243

mspiegel's picture
Offline
Joined: 07/31/2009
x below is the captured

x below is the captured result of the summary function.

> names(x)
 [1] "parameters"          "estimatedParameters" "observedStatistics" 
 [4] "degreesOfFreedom"    "SaturatedLikelihood" "Minus2LogLikelihood"
 [7] "Chi"                 "p"                   "AIC.Mx"             
[10] "BIC.Mx"              "RMSEA"              
> x$parameters
   name matrix row col parameter estimate error estimate
1  <NA>      A   1   6         0.39715247    0.010671937
2  <NA>      A   2   6         0.50366153    0.012602184
3  <NA>      A   3   6         0.57724183    0.014013832
4  <NA>      A   4   6         0.70277427    0.016683549
5  <NA>      A   5   6         0.79625063    0.018601170
6  <NA>      S   1   1         0.04081422    0.001966350
7  <NA>      S   2   2         0.03802001    0.001975058
8  <NA>      S   3   3         0.04082720    0.002205316
9  <NA>      S   4   4         0.03938708    0.002347691
10 <NA>      S   5   5         0.03628711    0.002583161
> x$parameters[,'error estimate']
 [1] 0.010671937 0.012602184 0.014013832 0.016683549 0.018601170 0.001966350
 [7] 0.001975058 0.002205316 0.002347691 0.002583161

Steve's picture
Offline
Joined: 07/30/2009
As an aside, in other R

As an aside, in other R parameter summary output tables, the "parameter estimate" column is called "Estimate" and "error estimate" is called "Std.Error".

I think it would be useful to change to these conventions before too many scripts start using the current non-standard names for the parameters.

mspiegel's picture
Offline
Joined: 07/31/2009
Column names changed.

Column names changed.