Re: [R] Confirmatory factor analysis using the sem package. TLI CFI and RMSEA absent from model summary.

2013-03-18 Thread Hervé Guyon

Hi Kevin,

With sem package use : summary(X,fit.indices=c(RMSEA,...)) to get 
RMSEA or anothers fit indices.

See the section ML.methods in sem.pdf

Hervé

Hervé
Le 18/03/2013 16:00, Kevin Cheung a écrit :

Hi R-help,

I am using the sem package to run confirmatory factor analysis (cfa) on some 
questionnaire data collected from 307 participants. I have been running R-2.15.3 in 
Windows in conjunction with R studio. The model I am using was developed from 
exploratory factor analysis of a separate dataset (n=439); it includes 18 items 
that load onto 3 factors. I have used the sem package documentation and this video 
(http://vimeo.com/38941937) to run the cfa and obtain a chi-square statistic for 
the model. However, when I use the summary() function, the model does not provide 
indices of fit; I need these as part of my analysis output. In particular, I am 
looking for the Tucker Lewis Index (TLI), Comparative Fit Index (CFI),  the 
Root Mean Square of Approximation (RMSEA). I have checked the documentation and 
cannot seem to find any reason for this; none of the arguments listed with the sem 
command indicate that I have to specify these as part of the output. In addition, 
the analysis example f!
  rom the video includes these indices as part of the output, but my analysis 
does not provide them. I have included my code with comments below:



library(sem)

validation.data -
structure(list(V1 = c(5L, 4L, 2L, 4L, 5L, 6L, 6L, 4L, 5L, 3L,
6L, 5L, 4L, 5L, 3L, 5L, 5L, 5L, 5L, 5L, 5L, 4L, 5L, 5L, 5L, 4L,
5L, 4L, 4L, 5L, 4L, 4L, 5L, 5L, 5L, 5L, 2L, 6L, 5L, 6L, 4L, 5L,
6L, 5L, 5L, 4L, 5L, 5L, 3L, 5L, 5L, 5L, 5L, 4L, 2L, 5L, 5L, 5L,
4L, 6L, 4L, 6L, 5L, 5L, 5L, 4L, 5L, 5L, 4L, 5L, 6L, 4L, 5L, 4L,
5L, 5L, 5L, 3L, 5L, 5L, 3L, 5L, 4L, 5L, 2L, 6L, 4L, 4L, 4L, 5L,
5L, 4L, 6L, 2L, 4L, 5L, 4L, 5L, 4L, 5L, 5L, 5L, 5L, 5L, 5L, 5L,
5L, 4L, 2L, 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, 5L, 6L, 5L, 4L, 

[R] MIMIC latent variable with PLS Path Modelling with R ?

2013-02-13 Thread Hervé Guyon

I want estimate MIMIC latent variable with R in a Monte Carlo simulation.
The packages plspm and semPLS don't permit to introduce MIMIC variable 
but only reflexives or formatives variables.
The only one program which permits to use MIMIC latent variable with 
PLSPM seems to be XLSTAT, which can not be used to simulate a lot of 
data bases.
It is a real challenge to develop a package with PLSPM and MIMIC latent 
variable…. And I prefer to use a package which exists.

Has someone a solution in R ?

Hervé

__
R-help@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.