Re: [R] SEM polychoric lavaan

2013-08-20 Thread yrosseel
On 08/12/2013 05:55 PM, Pablo Menese Camargo wrote: fitcfa - cfa(mcfa, data = data_analisis) summary(fitcfa, standardized = TRUE, fit.measure=TRUE) standardizedSolution(fitcfa, type = std.all) anyone know what y should do to apply polychoric? See the manual:

Re: [R] total indirect effects in structural equation modeling using lavaan

2013-02-22 Thread yrosseel
On 02/21/2013 03:59 PM, Marios wrote: My question...I would like to calculate the total indirect effects of all variables on the right-hand-side of the regression eqn's so that i can work out the total effect (indirect effects + direct effect) I know the direct effect and i can calculate

Re: [R] total indirect effects in structural equation modeling using lavaan

2013-02-22 Thread yrosseel
On 02/22/2013 11:40 AM, Marios wrote: Thank you very much Yves! I have managed to get the total indirect effects that i wanted but it seems to only work on the unstandardized coefficients. I use standardized =TRUE in the summary command but the std.all column has the same values as the Estimate

Re: [R] CFA with lavaan or with SEM

2013-01-25 Thread yrosseel
I am trying to use the cfa command in the lavaan package to run a CFA however I am unsure over a couple of issues. I have @25 dichotomous variables, 300 observations and an EFA on a training dataset suggests a 3 factor model. That is a lot of variables, and a rather small sample size (for

Re: [R] polycor package

2012-11-18 Thread yrosseel
The reason I was working with a correlation matrix is because I wanted to calculate polychoric correlations first before submitting it to the actual sem command. I was unsure whether R would use polychoric correlations when indicating which of the variables are ordered. A final question on the

Re: [R] Lavaan model

2012-10-31 Thread yrosseel
On 10/31/2012 02:47 PM, sylvain.giroud wrote: Dear R-users, Does somebody know what does the Estimate reported by the Lavaan model tell us? I assume this tells the relative strength of the dyadic relations. The 'Estimate' column contains the estimated model parameters. There are many

Re: [R] Error in rowMeans function

2012-10-15 Thread yrosseel
On 10/15/2012 08:28 AM, PIKAL Petr wrote: Hi -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- project.org] On Behalf Of Gunsalus, Catherine Sent: Friday, October 12, 2012 8:52 PM To: r-help@r-project.org Subject: [R] Error in rowMeans function Hello, I

Re: [R] two indirect effects of path analysis

2012-10-07 Thread yrosseel
On 10/07/2012 02:17 AM, Elaine Kuo wrote: Hello, This is Elaine. I am trying a path analysis using lavaan Package. There are three explanatory variables: X, Z, and M. The response variable is Y. A, b, and c have direct effects on Y. On the other hand, X and Z also have direct effects on M.

Re: [R] covariance estimate in function sem (Lavaan)

2012-08-11 Thread yrosseel
On 07/30/2012 11:00 PM, Luna wrote: Dear R users, I have a hard time interpreting the covariances in the parameter estimates output (standardized), even in the example documented (PoliticalDemocracy). Can anyone tell me if the estimated covariances are residual covariances (unexplained by the

Re: [R] easy way to fit saturated model in sem package?

2012-07-23 Thread yrosseel
I will check out the lavaan package. Dear Joshua, The lavaan package may help you. The FIML estimator typically starts with the EM algorithm to estimate the moments of the unrestricted model. There is no 'one-shot' function for it, at the moment, but if you only need those moments, you

Re: [R] FIML using lavaan returns zeroes for coefficients

2012-07-21 Thread yrosseel
On 07/20/2012 10:35 PM, Andrew Miles wrote: Hello! I am trying to reproduce (for a publication) analyses that I ran several months ago using lavaan, I'm not sure which version, probably 0.4-12. A sample model is given below: pathmod='mh30days.log.w2 ~ mh30days.log + joingroup + leavegroup +

Re: [R] FIML with missing data in sem package

2011-12-01 Thread yrosseel
On 12/01/2011 05:25 PM, Dustin Fife wrote: What is your goal? I have used and like mice pretty well, but using mice + sem to try to address missingness seems like more work than using FIML in OpenMx or lavaan to try to address it. Is there a reason you want to use the sem package or a reason

Re: [R] [Solved] Re: lavaan: how to analyse residuals of a latent variable

2011-08-10 Thread yrosseel
Maybe this kind of usage of lavaan is not very common, but in order to help others in my situation, is this documented somewhere? My understanding of latent variable analysis is indeed limited, but I did not understand that lavaan worked liked this when I read the documentation. This is not

Re: [R] lavaan: how to analyse residuals of a latent variable

2011-08-09 Thread yrosseel
My question is: how can I analyse the part of the variation in fire.setting that is not included in the latent variable criminality? Ideally I would want a new variable that captures just this. Then I could model regressions with this variable as the dependent variable. You can add a

Re: [R] lavaan: how to analyse residuals of a latent variable

2011-08-09 Thread yrosseel
Can I include criminality among those and thereby get the common part of criminality and fire.setting out of the way? No. You already regress fire.setting on criminality since it is an indicator in the measurement model of criminality. In other words, the 'criminality' part is already

Re: [R] Results of CFA with Lavaan

2011-06-09 Thread yrosseel
On 06/08/2011 11:56 PM, R Help wrote: Yes, that is the difference. For the last SEM I built I fixed the factor variances to 1, and I think that's what I want to do for the CFA I'm doing now. Does that make sense for a CFA? If you have a latent variable in your model (like a factor in CFA),

Re: [R] Results of CFA with Lavaan

2011-06-09 Thread yrosseel
On 06/09/2011 05:21 PM, R Help wrote: Ok, I think this is the last question I have. My model is producing an estimate of intercepts for my variables along with my loadings. From the documentation it appears that this is controlled by the meanstructure option in cfa. It says that setting it

Re: [R] Results of CFA with Lavaan

2011-06-09 Thread yrosseel
On 06/09/2011 06:06 PM, R Help wrote: I am using missing = 'fiml', which would require estimating intercepts. I figured they would effect my overall model fit, but can I still estimate my loading coefficients the same way? Yes, no problem. Yves Rosseel http://lavaan.org

Re: [R] error in model specification for cfa with lavaan-package

2011-06-01 Thread yrosseel
Dear Alain, As for the first error (sample covariance can not be inverted): Mike is right: with only 10 observations and 16 variables, the ML estimation of the sample cov produces a covariance matrix that is not positive definite, and hence the inversion (deliberately) fails. The lesson for

Re: [R] Structural equation modeling in R(lavaan,sem)

2011-04-05 Thread yrosseel
On 04/04/2011 07:14 PM, jouba wrote: Thanks you for your response For lavaan package can i have more information about this example you have applied in the section 7 the meanings of The variables (c1,c2,c3,c4, i ,s ,x1,x2) I think i have need more information to learn more about how able

Re: [R] Structural equation modeling in R(lavaan,sem)

2011-04-04 Thread yrosseel
On 04/03/2011 09:38 PM, jouba wrote: Daer all, I have a question concerning longitudinal data: When we have a longitudinal data and we have to do sem analysis there is in the package lavaan some functions,options in this package that help to do this or we can treat these data like non

Re: [R] Structural equation modeling in R(lavaan,sem)

2011-03-30 Thread yrosseel
On 03/29/2011 10:49 PM, jouba wrote: Dear all I have an error mesage « error message : the MLM estimator can not be used when data are incomplete » When i use the function sem(package lavaan) and when i fill the paramters estimator and missing estimator=MLM, missing=ml i understand

Re: [R] Structural equation modeling in R(lavaan,sem)

2011-03-28 Thread yrosseel
On 03/28/2011 04:18 AM, jouba wrote: Jeremy thanks a lot for your response I have read sem package help and I currently reading the help of lavaan I see that there is also an other function called lavaan can do the SEM analysis So I wonder what is the difference between this function and the

Re: [R] confirmatory factor analysis program in R

2011-03-24 Thread yrosseel
the cfa() function is in the 'lavaan' package -- View this message in context: http://r.789695.n4.nabble.com/confirmatory-factor-analysis-program-in-R-tp3386133p3401847.html Sent from the R help mailing list archive at Nabble.com. __

Re: [R] binary exogenous variable in path analysis in sem or lavaan

2011-03-24 Thread yrosseel
Rob, If 'sex' is indeed an exogenous variable (ie. predictor only), you can simply code it as (1=male, 2=female) and use it as a covariate in any sem model. In lavaan, you can explicitly use the argument 'fixed.x=TRUE', which will regard all exogenous covariates as fixed variables. Their