Learn R Programming

R2MLwiN (version 0.1-7)

xc: Examination scores of 16-year olds in Fife, Scotland.

Description

A dataset of examination scores of 16-year olds in Fife, Scotland, in which the secondary school the pupil attended is cross-classified by the primary school the pupil attended.

Arguments

source

Rasbash, J., Browne, W. J., Healy, M., Cameron, B., Charlton, C. M. J. (2013) MLwiN v2.27. University of Bristol: Centre for Multilevel Modelling.

Details

The xc dataset is one of the sample datasets provided with the multilevel-modelling software package MLwiN (Rasbash et al., 2013). The data are cross-classified in that not all children who attended the same primary school subsequently entered the same secondary school.)

See Also

See mlmRev package for an alternative format of the same dataset.

Examples

Run this code
# NB: change path as appropriate
MLwiN <- "C:/Program Files (x86)/MLwiN v2.27/"
data(xc)
# Fit cross-classified model, partitioning variance in ATTAIN across
# and within primary (PID) and secondary (SID) school
F1 = "ATTAIN ~ (0|CONS) + (3|CONS) + (2|CONS) + (1|CONS)"
ID = c("SID", "PID", "PUPIL")
MyXC <- list("class" = c(3, 2),"N1" = c(1, 1))
(XCModel <- runMLwiN(Formula = F1, levID = ID, indata = xc, 
estoptions = list(xclass = MyXC, EstM = 1), MLwiNPath = MLwiN))

Run the code above in your browser using DataLab