Displaying 20 results from an estimated 6000 matches similar to: "CFA in R/sem package"
2006 Aug 10
5
Variance Components in R
Hi,
I'm trying to fit a model using variance components in R, but if very
new on it, so I'm asking for your help.
I have imported the SPSS database onto R, but I don't know how to
convert the commands... the SPSS commands I'm trying to convert are:
VARCOMP
RATING BY CHAIN SECTOR RESP ASPECT ITEM
/RANDOM = CHAIN SECTOR RESP ASPECT ITEM
/METHOD = MINQUE (1)
/DESIGN
2010 Jun 18
3
Non-procedural access to columns of a matrix
Hi,
I would like to have an index for a column in a matrix encoded in a
cell of the same matrix.
For example:
x = matrix(c(11,12,13,1,
21,22,23,3,
31,32,33,2),byrow=T,ncol=4)
In this case, column 4 is the index. I then access the column
specified in the index by:
> for (i in 1:3) print(x[i,x[i,4]])
[1] 11
[1] 23
[1] 32
>
> for (i in 1:3) {x[i,x[i,4]] <- x[i,x[i,4]] + 5}
> x
2006 Sep 20
8
Statitics Textbook - any recommendation?
I would like to buy a basic statistics book (experimental design,
sampling, ANOVA, regression, etc.) with examples in R. Or download it
in PDF or html format.
I went to the CRAN contributed documentation, but there were only R
textbooks, that is, textbooks where R is the focus, not the
statistics. And I would like to find the opposite.
Other text I am trying to find is multivariate data
2013 Jan 23
2
CFA with lavaan or with SEM
Hi
Sorry for the rather long message.
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.
After defining the model I use the command
fit.dat <- cfa(model.1, data=my.dat, std.lv = T, estimator="WLSMV",
2006 Aug 16
1
Specifying Path Model in SEM for CFA
I'm using specify.model for the sem package. I can't figure out how to
represent the residual errors for the observed variables for a CFA
model. (Once I get this working I need to add some further constraints.)
Here is what I've tried:
model.sa <- specify.model()
F1 -> X1,l11, NA
F1 -> X2,l21, NA
F1 -> X3,l31, NA
F1 -> X4,l41, NA
F1 -> X5, NA, 0.20
2012 Jan 21
1
Function for multiple t tests
Hi,
I want to run t.test() for several variables among two groups, and I
would like to skip the tedious process of collecting information to
assemble a table, but I am not sure if the function I want already
exists. Any suggestion would be appreciated.
I have a working example, as required by the posting guide:
my_swiss = swiss[-1,]
my_swiss$facto = rep(1:2,nrow(my_swiss)/2)
2018 Feb 26
3
Precision in R
Hi,
Why sum() on a 10-item vector produces a different value than its
counterpart on a 2-item vector? I understand the problems related to
the arithmetic precision in storing decimal numbers in binary format,
but shouldn't the errors be equal regardless of the method used?
See my example:
> options(digits=22)
> x=rep(.1,10)
> x
[1] 0.10000000000000001 0.10000000000000001
2009 Feb 16
1
Help with rgl
Hi,
I don't know much about the RGL package, and I have read the
documentation and tried some parameters, with no luck... I would like
to generate a movie from a 3D object (code below), where the vortex A
is closer to the observer, and then the object rotates and the B
vortex gets closer. I would like to capture this movie to a file.
By the way, I am not being able to insert unicode text
2011 Jun 08
1
Autocorrelation in R
Hi,
I am trying to learn time series, and I am attending a colleague's
course on Econometrics. However, he uses e-views, and I use R. I am
trying to reproduce his examples in R, but I am having problems
specifying a AR(1) model. Would anyone help me with my code?
Thanks in advance!
Reproducible code follows:
download.file("https://sites.google.com/a/proxima.adm.br/main/ex_32.csv
2011 Jun 08
2
Results of CFA with Lavaan
I've just found the lavaan package, and I really appreciate it, as it
seems to succeed with models that were failing in sem::sem. I need
some clarification, however, in the output, and I was hoping the list
could help me.
I'll go with the standard example from the help documentation, as my
problem is much larger but no more complicated than that.
My question is, why is there one latent
2009 Nov 08
1
Models for Discrete Choice in R
Hi,
I would like to fit Logit models for ordered data, such as those
suggested by Greene (2003), p. 736.
Does anyone suggests any package in R for that?
By the way, my dependent variable is ordinal and my independent
variables are ratio/intervalar.
Thanks,
Iuri.
Greene, W. H. Econometric Analysis. Upper Saddle River, NJ: Prentice Hall, 2003
2011 Mar 27
2
Structural equation modeling in R(lavaan,sem)
I am a new user of the function sem in package sem and lavaan for structural
equation modeling
1. I don?t know what is the difference between this function and CFA
function, I know that cfa for confirmatory analysis but I don?t know what
is the difference between confirmatory analysis and structural equation
modeling in the package lavaan.
2. I have data that I want to analyse but I have some
2004 May 12
1
Sem error - subscript out of bounds
What??s happening with this following code:
require(sem)
Celpe.Mod.RAM <- matrix(c(
# path parametro Inicio
"Produ????o -> T1", "gamma.11", NA,
"Produ????o -> T2", "gamma.12", NA,
2008 Sep 18
2
Difficulty understanding sem errors / failed confirmatory factor analysis
Hello,
I'm trying to fit a pretty simple confirmatory factor analysis using
the sem package. There's a CFA example in the examples, which is helpful,
but the output for my (failing) model is hard to understand. I'd be
interested in any other ways to do a CFA in R, if this proves troublesome.
The CFA is replicating a 5 uncorrelated-factor structure (for those
interested, it is a
2009 Jul 20
3
Another SEM question
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|)
2009 Oct 31
3
Plots with k-means
Hi,
I'm doing a k-means cluster with 6 clusters and 15 variables. Any
suggestions on how to plot the results?
I've tried the standard xy plot, but couldn't get much of it.
Thansk in advance,
Iuri.
2011 Nov 08
1
Help with SEM package: Error message
Hello.
I started using the sem package in R and after a lot of searching and trying
things I am still having difficulty. I get the following error message when
I use the sem() function:
Warning 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 started with a
2008 May 07
1
interpreting significance of path coefficients from sem() output
Hi there,
Quick question about the output from the sem() function in the library
of the same name.
If I am getting probabilities >0.05 for some of my estimates of path
coefficients, I'm assuming the interpretation here is that the
coefficient is not significantly different from zero, correct? In that
case, might it make sense that I should disregard path coefficients
between
2010 Apr 05
1
Using pch with the RGL library
Hi,
I am trying to compare two 3D plots. For that, I am trying to use the
"pch" parameter in the "points3d" function, but it is not working. Is
it implemented? Any suggestion?
Here goes a reproducible code. I wanted the second plot having
different symbols for the points.
x <- rbind(matrix(rnorm(100, sd = 0.3), ncol = 2),
matrix(rnorm(100, mean = 1, sd = 0.3),
2011 Apr 11
1
Meta-analysis of a correlation matrix
Sorry for the cross-posting, but I would like to know if anyone is
aware of a package in R for this.
---------- Forwarded message ----------
From: John Antonakis
Sent: Sunday, April 10, 2011 3:26 PM
To: RMNET
Subject: Meta-analysis of a correlation matrix (correct thread title)
Hi:
Does anyone know of good program that can do a meta-analytic multiple
regression (with multiple correlated