cvd {R2MLwiN}R Documentation

Data from the 1998 Scottish Health Survey on cardiovascular disease status of 8804 respondents

Description

Data from the 1998 Scottish Health Survey, with 8804 respondents aged between 18 and 64. The outcome, cvddef, is a self-report of a doctor-diagnosed cardiovascular disease (CVD) condition (angina, diabetes, hypertension, acute myocardial infarction, etc.). This is a binary response, whether (1) or not (0) respondents have CVD condition.

Usage

cvd

Format

A data frame with 8804 observations on the following 9 variables:

age

Age.

sex

Gender (factor with levels: male, female).

sc

Social class (factor with levels: 12 (social class 1 and 2), 3 (social class 3), 45 (social class 4 and 5)).

cvddef

Self-reported cardiovascular disease (0 = does not have condition, 1 = has condition)

carstair

Carstairs score.

smoke

Smoking frequency (factor with levels: lite (<10 a day), mod (10-19 a day), hvy (20+ a day), ex (ex-smoker), nevr (never smoked)).

id

Respondent identifier.

area

Postcode sector

Details

The cvd dataset is one of the example datasets analysed in Leyland and Groenewegen (2020), and provided with the multilevel-modelling software package MLwiN (Charlton et al., 2024), as cvd_data.

Source

Charlton, C., Rasbash, J., Browne, W.J., Healy, M. and Cameron, B. (2024) MLwiN Version 3.09 Centre for Multilevel Modelling, University of Bristol.

Leyland A.H. (2005) Socioeconomic gradients in the prevalence of cardiovascular disease in Scotland: the roles of composition and context. J Epidemiol Community Health 59:799–803

Leyland, A.H., Groenewegen, P.P. (2020). Untangling Context and Composition. In: Multilevel Modelling for Public Health and Health Services Research. Springer, Cham. doi:10.1007/978-3-030-34801-4_13

Examples


## Not run: 

data(cvd, package = "R2MLwiN")

# Example taken from Leyland and Groenewegen (2020)

F1 <- logit(cvddef) ~ 1 + I(age^3) + I(age^3):I(log(age)) +
  sex + sex:I(age^3) + sex:I(age^3):I(log(age)) +
  (1 | area)

(mod_MQL1 <- runMLwiN(Formula = F1,
                      D = "Binomial",
                      data = cvd))

(mod_PQL2 <- runMLwiN(Formula = F1,
                      D = "Binomial",
                      data = cvd,
                      estoptions = list(
                        nonlinear = c(N = 1, M = 2),
                        startval = list(FP.b = mod_MQL1@FP,
                                        FP.v = mod_MQL1@FP.cov,
                                        RP.b = mod_MQL1@RP,
                                        RP.v = mod_MQL1@RP.cov))))

## End(Not run)

[Package R2MLwiN version 0.8-9 Index]