N <- 10000
x <- rnorm(N)
y1 <- 0.55*x + rnorm(N)
y2 <- 0.24*x + 0.47*y1 #+ rnorm(N) OR rnorm(N,,5) <- models differ here, whetherto include one option or the other
Model with no defined Std. Err.
rm(list=ls(all=TRUE))
N <- 10000
x <- rnorm(N)
y1 <- 0.55*x + rnorm(N)
y2 <- 0.24*x + 0.47*y1 + rnorm(N)
LinearMedData <- data.frame(x, y1,y2)
#Data analysis
LinearMedMod <- 'y1~a*x
y2~b*x+ c*y1
'
fitLinearMedMod <- sem(LinearMedMod, data = LinearMedData)
summary(fitLinearMedMod)
Regressions:
Estimate Std.Err z-value P(>|z|)
y1 ~
x (a) 0.537 0.010 54.050 0.000
y2 ~
x (b) 0.242 0.011 21.165 0.000
y1 (c) 0.463 0.010 45.746 0.000
Variances:
Estimate Std.Err z-value P(>|z|)
.y1 0.985 0.014 70.711 0.000
.y2 1.011 0.014 70.711 0.000
Model with defined Std. Err.
rm(list=ls(all=TRUE))
N <- 10000
x <- rnorm(N)
y1 <- 0.55*x + rnorm(N)
y2 <- 0.24*x + 0.47*y1 + rnorm(N,,5)
LinearMedData <- data.frame(x, y1,y2)
#Data analysis
LinearMedMod <- 'y1~a*x
y2~b*x+ c*y1
'
fitLinearMedMod <- sem(LinearMedMod, data = LinearMedData)
summary(fitLinearMedMod)
Regressions:
Estimate Std.Err z-value P(>|z|)
y1 ~
x (a) 0.557 0.010 55.853 0.000
y2 ~
x (b) 0.197 0.057 3.475 0.001
y1 (c) 0.458 0.050 9.206 0.000
Variances:
Estimate Std.Err z-value P(>|z|)
.y1 1.005 0.014 70.711 0.000
.y2 24.894 0.352 70.711 0.000
On 9 Apr 2019, at 10.51, gaia...@usal.es wrote:
Good morning,I tried to find and answer to this question in the forum and find no reply. In any case, I apologize if this has been answered before.can I manipulate the Std.error of an estimate without altering the estimate value?
I tried to do it by increasing the Std. Error term in rnorm(N,mean,Std. Error). However, by comparing two models one with Std Error and and with it modified (see below), I realized that
N <- 10000
x <- rnorm(N)
y1 <- 0.55*x + rnorm(N)
y2 <- 0.24*x + 0.47*y1 #+ rnorm(N) OR rnorm(N,,5) <- models differ here, whetherto include one option or the other
1) the estimate is less accurate when modifying the Std Error (0.242 vs 0.197). Why? it is possible to modify the variance of a regression without modifying the estimate of the slopes, right?
2) While the variance of the variable increase according to the set value, the Std Error of the estimate (what I want to manipulate) do not do it
3) Is it possible to manipulate the Std error of the estimate of x without doing for y1? is is possible to do like that?y2 <- 0.24*x + rnorm(N)
y2 <- 0.47*y1 +rnorm(N,,5)
--
You received this message because you are subscribed to the Google Groups "lavaan" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lavaan+un...@googlegroups.com.
To post to this group, send email to lav...@googlegroups.com.
Visit this group at https://groups.google.com/group/lavaan.
For more options, visit https://groups.google.com/d/optout.
Regressions:
Estimate Std.Err z-value P(>|z|)
y1 ~
x (a) 0.537 0.010 54.050 0.000
y2 ~
x (b) 0.242 0.011 21.165 0.000