Learn R Programming

R2MLwiN (version 0.1-7)

jspmix1: Dataset of pupils' test scores, a subset of the Junior School Project.

Description

An educational dataset of pupils' test scores, a subset of the Junior School Project (Mortimore et al., 1988).

Arguments

source

Browne, W. J. (2012) MCMC Estimation in MLwiN Version 2.26. University of Bristol: Centre for Multilevel Modelling. Mortimore, P., Sammons, P., Stoll, L., Lewis, D., Ecob, R. (1988) School Matters. Wells: Open Books. 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

A subset of the Junior School Project (Mortimore et al., 1988), the jspmix1 dataset is one of the sample datasets provided with the multilevel-modelling software package MLwiN (Rasbash et al., 2013), and is used in Browne (2012) as an example of modelling mixed responses. It consists of test scores for 1119 pupils across 47 schools. Note that the behaviour variable originally had three categories, and the middle 50% and top 25% have been combined to produce a binary variable.)

Examples

Run this code
# NB: change path as appropriate
MLwiN <- "C:/Program Files (x86)/MLwiN v2.27/"
data(jspmix1)
# behaviour coded 0/1
jspmix1$behaviour <- as.numeric(jspmix1$behaviour) - 1

# fit multilevel mixed response model, modelling effect of sex
# and ravens on both responses, and fluent on english response only
F1 = "c(english, probit(behaviour, cons)) ~ (0s|cons + sex + ravens) 
+ (0c|fluent{1, 0}) + (2s|cons) + (1s|cons.english)"
ID = c("school", "id")
(MixedRespMCMC <- runMLwiN(Formula = F1, levID = ID, 
D = c("Mixed", "Normal", "Binomial"), indata = jspmix1, 
estoptions = list(EstM = 1, mcmcMeth = list(fixM = 1, residM = 1, Lev1VarM = 1)),
MLwiNPath = MLwiN))

Run the code above in your browser using DataLab