On 15 Feb 2017, at 10.10, p007...@brookes.ac.uk wrote:I am asking R to read an SPSS file in which discrete missing variables are coded as '99' for some scores (student achievement grades). Does R have an automatic ability to also detect these are missing variables or will I need to recode cells where there are missing variables in SPSS so that they are blank?
I currently have invariance when running a model and wonder if it may be caused by this. I am using FIML.Many thanksCarol
--
You received this message because you are subscribed to the Google Groups "lavaan" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lavaan+un...@googlegroups.com.
To post to this group, send email to lav...@googlegroups.com.
Visit this group at https://groups.google.com/group/lavaan.
For more options, visit https://groups.google.com/d/optout.
On 15 Feb 2017, at 10.30, p007...@brookes.ac.uk wrote:Dear MikkoThanks for such a quick response to this. How do I print the dataset to console?
I tried view -> show file and selected the relevant but it opened the original SPSS file?
# (b) How do socio-economic status, gender and school sector affect achievement the STV attached to A-level achievement?
rq.4 <- '
# Measurement part
#STV (excluding utility)
intrinsic =~ Q21 + Q30
attainment =~ Q25 + Q31 + Q37
STV =~ intrinsic + attainment
SES =~ momed + daded + ISEImo2 + ISEIfa2 + books + homepossessions
# Structural part
STV ~ SES + girl + school'
fit <- sem(rq.4, data = mydata, missing='fiml', estimator='MLR')
summary(fit, fit.measures=TRUE, standardized = TRUE)
inspect(fit, 'r2')
inspect(fit,'cor.lv')
semPaths (fit, what="std",
style="lisrel",edge.color="black", fade=FALSE,
edge.width=0.5, nCharNodes=7, intercepts = FALSE)
Hi,
To unsubscribe from this group and stop receiving emails from it, send an email to lavaan+unsubscribe@googlegroups.com.
To post to this group, send email to lav...@googlegroups.com.
Visit this group at https://groups.google.com/group/lavaan.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the Google Groups "lavaan" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/lavaan/lF-2GNKJUaM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to lavaan+unsubscribe@googlegroups.com.
To post to this group, send email to lav...@googlegroups.com.
Visit this group at https://groups.google.com/group/lavaan.
For more options, visit https://groups.google.com/d/optout.
On 15 Feb 2017, at 11.23, Carol Brown <carol...@brookes.ac.uk> wrote:MorningYes I am using RStudio. So do I just add print(data) at the bottom?Sorry for the questions! I am just learning R for the first time for my thesis.
Hi,
To unsubscribe from this group and stop receiving emails from it, send an email to lavaan+unsubscribe@googlegroups.com.
To post to this group, send email to lav...@googlegroups.com.
Visit this group at https://groups.google.com/group/lavaan.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the Google Groups "lavaan" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/lavaan/lF-2GNKJUaM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to lavaan+unsubscribe@googlegroups.com.
To post to this group, send email to lav...@googlegroups.com.
Visit this group at https://groups.google.com/group/lavaan.
For more options, visit https://groups.google.com/d/optout.
data <- as.data.frame(matrix(sample(c(1:5,99),100, replace = TRUE),20,5))sample(Ralph,100, replace = TRUE)sample(x = Ralph, size = 100, replace = TRUE)
matrix(Alice,20,5)
The first three parameters to the matrix() function are data, nrow, and ncol. So, this is taking the data from Alice and arranging it in a matrix with 20 rows and 5 columns. Let's call that Trixie.
Trixie <- matrix(data=Alice, nrow=20, ncol=5)
as.data.frame(Trixie)