Displaying 20 results from an estimated 10000 matches similar to: "code for automating the sem package"
2008 May 29
1
appropriate covariance matrix for multiple nominal exogenous and multiple continuous endogenous variables in SEM
Hi,
I would like to use the sem package to perform a path analysis (no
latent variables) with a mixture of 2 nominal exogenous, 1 continuous
exogenous, and 4 continuous endogenous variables. I seek advice as to
how to calculate the appropriate covariance matrix for use with the sem
package.
I have read through the polycor package, and am confused as to the use
of "numeric" for
2008 Jun 03
0
Summarizing dummy coefficients in sem package
Greetings,
I am working in the sem package on a model with 3 exogenous variables (2
are nominal-categorical), and 4 endogenous, continuous variables. To
use sem with the nominal variables, I created dummy variables. Now, in
my sem output I have estimates for path coefficients for the
relationship between each level of the nominal variables and the
endogenous variables they are associated
2012 Jul 12
1
easy way to fit saturated model in sem package?
Hi,
I am wondering if anyone knows of an easy way to fit a saturated model
using the sem package on raw data? Say the data were:
mtcars[, c("mpg", "hp", "wt")]
The model would estimate the three means (intercepts) of c("mpg",
"hp", "wt"). The variances of c("mpg", "hp", "wt"). The covariance
of mpg with
2011 Mar 17
2
Incorrect degrees of freedom in SEM model using lavaan
I have been trying to use lavaan (version 0.4-7) for a simple path model,
but the program seems to be computing far less degrees of freedom for my
model then it should have. I have 7 variables, which should give (7)(8)/2 =
28 covariances, and hence 28 DF. The model seems to only think I have 13
DF. The code to reproduce the problem is below. Have I done something
wrong, or is this something I
2007 Mar 16
0
Segmentation fault in estimating structural equation models with the SEM package.
Dear R-users,
I am running a large number of simulations and estimating a
structural equation model for each one using the SEM package. Each
run of my program has around 8000 simulations. Most of the time the
program completes all of them correctly but sometimes I get a
segmentation fault in the sem routine and my program stops with the
following error message:
> *** caught
2011 Nov 07
0
new version 2.0-0 of the sem package
Dear R users,
Jarrett Byrnes and I would like to announce version 2.0-0 of the sem package
for fitting observed- and latent-variable structural equation models. This
is a general reworking of the original sem package (which is still available
on R-Forge as package sem1).
Some highlights of sem 2.0-0 include:
o More convenient and compact model specification, including the default
automatic
2011 Nov 07
0
new version 2.0-0 of the sem package
Dear R users,
Jarrett Byrnes and I would like to announce version 2.0-0 of the sem package
for fitting observed- and latent-variable structural equation models. This
is a general reworking of the original sem package (which is still available
on R-Forge as package sem1).
Some highlights of sem 2.0-0 include:
o More convenient and compact model specification, including the default
automatic
2011 Feb 08
1
SEM: question regarding how standard errors are calculated
Sorry if this question has been asked previously, I searched but found
little. There also doesn't seem to be a dedicated SEM list-serv so hopefully
this will find its way to the appropriate audience.
In discussing SEM with a colleague I mentioned that a model they were
fitting in AMOS was equivalent to a linear regression and that the
coefficients would be the same. This of course was the
2008 Apr 01
1
SEM with a categorical predictor variable
Hi,
we are trying to do structural equation modelling on R. However, one of our
predictor variables is categorical (smoker/nonsmoker). Now, if we want to
run the sem() command (from the sem library), we need to specify a
covariance matrix (cov). However, Pearson's correlation does not work on the
dichotomous variable, so instead we produced a covariance matrix using the
Spearman's (or
2010 Sep 16
0
problems trying to reproduce structural equation model using the sem package
Hello,
I've been unsuccessfully trying to reproduce a sem from Grace et al.
(2010) published in Ecological Monographs:
http://www.esajournals.org/doi/pdf/10.1890/09-0464.1
The model in question is presented in Figure 8, page 81. The errors
that I've been getting are:
1. Using a correlation matrix:
res.grace <- sem(grace.model, S = grace, N = 190)
Warning message:
In sem.default(ram
2009 Mar 09
1
[sem package] path.diagram() ignores the edge.label argument ..?
hi,
I plot path diagrams with the path.diagram() function of the sem
package in combination with the graphviz application.
Now I want the graphviz code for a path-plot with the actual
standardized coefficients on the arrows (not the names).
I tried to add edge.labels="values" as an argument to path.diagram()
but it's just ignored.
can anyone help me on that?
p.s.;
2012 Aug 03
1
SEM standardized path coefficients
Hello,
I have conducted an SEM in which the resultant standardized path coefficients are much higher than would be expected from the raw correlation matrix. To explore further, I stripped the model down to a simple bivariate relationship between two variables (NDVI, and species richness), where it's my understanding that the SEM's standardized path coefficient should equal the correlation
2006 Jun 28
3
Problem with package sem
Hi experts,
I just started to learn R today, and tried to work with an add-on
package sem. I have a version of 2.3.1 on MacOS X 10.4.6 with sem put
under /Library/Frameworks/R.framework/Versions/2.3/Resources/library
However when I typed
library(sem)
the following error showed up:
Error in library(sem) : 'sem' is not a valid package -- installed <
2.0.0?
Why is this?
Thank
2009 Feb 02
1
Fit indexes in SEM with categorical data + ML estimation
Hello,
It has been found that SEM analysis using polychoric correlations + maximum
likelihood estimator produces incorrect test statistics and standard errors
(e.g., Flora, D. B., & Curran, P. J. (2004). An Empirical Evaluation of
Alternative Methods of Estimation for Con?rmatory Factor Analysis With
Ordinal Data. Psychological Methods, 9(4), 466-491).
Standard errors can be dealt with by
2008 Nov 13
0
sem and "simple variables"
salutations!
i am doing some longitudinal modeling with sem and thought calculating some
"simple variables" would make my model more readable. this is the smallest
subset of my model that illustrates the resulting problem.
i have 2 observed exogenous variables (c1, d2) and 4 observed endogenous
variables (dc1, dd1, dc2, dd2). c1 is the observed state at time 1, dc1 is
the change in c
2007 Apr 11
1
creating a path diagram in sem
Hello,
I finally run my measurement model in sem - successfully. Now, I am trying to print out the path diagram that is based on the results - but for some reason it's not working. Below is my script - but the problem is probably in my very last line:
# ANALYSIS OF ANXIETY, DEPRESSION, AND FEAR - LISREL P.31
library(sem)
# Creating the ANXIETY, DEPRESSION, AND FEAR intercorrelation matrix
2012 May 04
1
sem error message
Hello, I tried to do a 'sem' analysis for data of how blueberry consumption
by birds is influenced by a pollution gradient, using distance and
vegetation structural and composition variables, but I got the following
error message:
Error in sem.default(ram = ram, S = S, N = N, param.names = pars, var.names
= vars, :
S must be a square triangular or symmetric matrix
This may be very
2009 Aug 11
0
SEM decomposition of Hessian
I'm trying to run an SEM, but I keep getting the following error message.
In sem.default(ram = ram, S = S, N = N, param.names = pars, var.names = vars, :
Could not compute QR decomposition of Hessian.
Optimization probably did not converge.
I have 4 latent variables (plant, AMF, abiotic, and soilAgg) with 2 or 4 indicator variables for each latent variable.My model is specified as:
>
2012 Oct 23
1
SEM multigroup modeling
Hello,
I am using the SEM package in R to fit a multigroup latent variable model and ran into some difficulties. I have 2 questions:
1. First, I am getting the following error message and wondering what to do to fix it:
Error in solve.default((N[g] - 1) * robustVcov(mod.g, adj.obj = adj.objects[[g]])) :
system is computationally singular: reciprocal condition number = 4.52055e-23
2004 Oct 28
0
sem : Error in solve.default(C[ind, ind]) : Lapack routine dgesv: system is exactly singular
Hi R-users:
When I run the R script (as the following), I got the error message:
Error in solve.default(C[ind, ind]) : Lapack routine dgesv: system is
exactly singular.
Any help is appreciated.
Ying
library(sem)
R.pw <- matrix(c(
1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0.2137356, 0.2137356, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,