[R] Another SEM question

Jarrett Byrnes byrnes at msi.ucsb.edu
Tue Jul 21 08:18:47 CEST 2009


You don't appear to be defining Z here.

Might that be the problem?

Or, I, M, and R may not be defined either.  It is unclear.  What does  
mod.cov look like?

On Jul 20, 2009, at 11:11 PM, Stein, Luba (AIM SE) wrote:

> Thank you for your advice. So I am sending the whole code
>
> data.dir <- file.path(home.dir, "Data")
> file     <- file.path(data.dir, "data4.csv")
>
> SEM <- read.csv(file)
> print(SEM)
>
> library(sem)
> SEM1 <- as.matrix(cbind(SEM$R1, SEM$I1, SEM$M1))
> print(SEM1)
> mod.cov <- cov(SEM1)
> print(mod.cov)
>
> I <- SEM$I1
> M <- SEM$M1
> R <- SEM$R1
>
> model <- specify.model()
> Z -> M
> Z -> I
> Z -> R
> M <-> M
> I <-> I
> R <-> R
> Z <-> Z
>
> sem.mod <- sem(model, mod.cov, N=109)
> summary(sem.mod)
>
>
>
> All vectors have a length of 109.
>
>
> Thank you for your help once again.
>
> Best wishes,
> Luba
>
>
>
> -----Urspr?ngliche Nachricht-----
> Von: r-help-bounces at r-project.org [mailto:r-help-bounces at r- 
> project.org] Im Auftrag von Jarrett Byrnes
> Gesendet: Montag, 20. Juli 2009 18:25
> An: Stein, Luba (AIM SE)
> Cc: r-help at r-project.org
> Betreff: Re: [R] Another SEM question
>
> Luba,
>
> If you could provide the code you ran, perhaps the listserv can be of
> help.
>
> On Jul 20, 2009, at 7:55 AM, Stein, Luba (AIM SE) wrote:
>
>> Hello,
>>
>> I use the function sem the following way
>> sem.mod <- sem(model, mod.cov, N=109) where the variables are
>> modelled:
>>
>> Z -> M
>> Z -> I
>> Z -> R
>> M <-> M
>> I <-> I
>> R <-> R
>> Z <-> Z
>>
>> The output is
>> ...
>>
>> Normalized Residuals
>> Min. 1st Qu. Median Mean 3rd Qu. Max.
>> -7.3300 -0.2750 -0.2670 -0.1290 -0.0369 9.0300
>>
>> Parameter Estimates
>> Estimate Std Error z value Pr(>|z|)
>> 0.0021625 0.00017037 12.693 0 M <--- Z
>>
>> Iterations = 13
>>
>>
>> In "Structural Equation Modeling With the sem Package in R" by John
>> Fox is stated that there should be an output for each external
>> variable.
>>
>> Where is my fault, that I receive the output only for the first
>> variable?
>>
>>
>> Thanks for your help,
>> Luba
>>
>>
>>
>>
>>
>> 	[[alternative HTML version deleted]]
>>
>> ______________________________________________
>> R-help at r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.




More information about the R-help mailing list