Learn R Programming

R2MLwiN (version 0.8-9)

alevchem: Chemistry A-level results from one exam board

Description

Chemistry A-level results from one exam board; subset from Yang & Woodhouse, 2001. See also Rasbash et al. (2012) and Browne (2012).

Usage

alevchem

Arguments

Format

A data frame with 2166 observations on the following 8 variables:

lea

Local Education Authority ID.

estab

Establishment (institution) ID.

pupil

Pupil ID.

a_point

A-level point score (an ordered factor with levels: F, E, D, C, B, A).

gcse_tot

Total GCSE point score.

gcse_no

Number of GCSEs taken.

cons

Constant of ones

gender

Pupil's gender (a factor with levels: male, female).

Details

The alevchem dataset is one of the sample datasets provided with the multilevel-modelling software package MLwiN (Rasbash et al., 2009).

Examples

Run this code

if (FALSE) {

data(alevchem, package = "R2MLwiN")

alevchem$gcseav <- alevchem$gcse_tot/alevchem$gcse_no - 6

# Note: Establishment codes on their own do not uniquely identify schools.
# Schools are instead uniquely identified by LEA code, establishment ID
# combination. Thus, here we generated a unique school ID.

alevchem$school <- as.numeric(factor(paste0(alevchem$lea, alevchem$estab)))

(mymodel <- runMLwiN(logit(a_point, cons, 6) ~ 1 + gcseav[1:5] + I(gcseav^2)[1:5] +
  gender[1:5] + (1[1:5] + gcseav[1:5] | school), 
  D = "Ordered Multinomial", estoptions = list(EstM = 1), data = alevchem))

}

Run the code above in your browser using DataLab