| HSwls | R Documentation |
A dataset containing cognitive test scores x1 to x9 for 301 students from two schools.
This is a modified version of the classic lavaan::HolzingerSwineford1939 or OpenMx's OpenMx::HS.ability.data dataset (which contains the original continuous data),
where the variables x1 to x9 have been converted into ordered factors (2, 3, or 4 categories)
using quantile-based cuts. It is designed for demonstrating and teaching Weighted Least Squares (WLS)
estimation with ordinal data.
data(HSwls)
A data frame with 301 rows and 15 variables.
The variables are:
id: Student ID
sex: Gender (1 = male, 2 = female)
ageyr: Age in years
agemo: Age in months
school: School (Grant-White or Pasteur)
grade: Grade (7 or 8)
x1: Visual perception (2-category ordered factor)
x2: Cubes (2-category ordered factor)
x3: Lozenges (2-category ordered factor)
x4: Paragraph comprehension (3-category ordered factor)
x5: Sentence completion (3-category ordered factor)
x6: Word meaning (3-category ordered factor)
x7: Speeded addition (4-category ordered factor)
x8: Code (4-category ordered factor)
x9: Speeded counting of dots (4-category ordered factor)
Holzinger, K. J., & Swineford, F. (1939). A study in factor analysis: The stability of a bi-factor solution. Supplementary Educational Monographs, no. 48. Chicago: University of Chicago Press.
OpenMx::HS.ability.data, umxRAM()
Other datasets:
Anthro_LDSC,
Fischbein_wt,
GFF,
Psych_LDSC,
docData,
iqdat,
umx,
us_skinfold_data
## Not run:
data(HSwls)
# x1:x3 represent visual perception
# x4:x6 represent verbal ability
# x7:x9 represent speed
m1 = umxRAM("WLS_HS", data = HSwls, type = "DWLS",
umxPath(v1m0 = c("visual", "verbal", "speed")),
umxPath(from = "visual", to = c("x1", "x2", "x3")),
umxPath(from = "verbal", to = c("x4", "x5", "x6")),
umxPath(from = "speed" , to = c("x7", "x8", "x9")),
umxPath(unique.bivariate = c("visual", "verbal", "speed")),
umxPath(v.m. = c("x1", "x2", "x3", "x4", "x5", "x6", "x7", "x8", "x9"))
)
plot(m1, means=FALSE, std=TRUE, splines=FALSE, min = c("visual", "verbal", "speed"))
umxSummary(m1, uncertainty= "MLR")
data(HS.ability.data)
df = HS.ability.data
verbal = c("general" , "paragrap", "sentence")
space = c("visual" , "cubes" , "flags" )
math = c("addition", "code" , "counting")
manifests = c(verbal, space, math)
out = factanal(df[, manifests], factors = 3, scores = "Bartlett", na.action = na.exclude)
m1 = umxRAM("One Factor", data = df,
umxPath(v1m0 = "G"),
umxPath(v.m. = c(manifests, "V", "S", "M")),
umxPath(from = "V", to = verbal),
umxPath(from = "S", to = space),
umxPath(from = "M", to = math),
umxPath(from = "G", to = c("V", "S", "M"))
)
plot(m1, means=FALSE, std=TRUE, max= manifests, min="G", same= c("V", "S", "M"))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.