Learn R Programming

mixor (version 1.0.4)

norcag: Attitudes Towards Sex Data from the 1989 General Social Survey

Description

Each subject provided ordinal responses on three items concerning their opinion on early teens (age 14-16) having sex before marriage (Item1), a man and a woman having sex before marriage (Item2), and a married person having sex with someone other than their spouse (Item3). Data are provided as frequencies by response pattern.

Usage

data(norcag)

Arguments

Format

A data frame with 105 observations on the following 6 variables.

ID

a numeric vector indicating unique patient identifier

SexItems

ordinal item response coded as 1 = always wrong; 2 = almost always wrong; 3 = wrong only sometimes; 4 = not wrong

int

a numeric vector of ones; used in the stand-alone MIXOR program to indicate the intercept

Item2vs1

attitude towards premarital vs teenage sex

Item3vs1

attitude towards extramarital vs teenage sex

freq

frequency weight of the pattern

References

Hedeker D. and Mermelstein R.J. (1998) A multilevel thresholds of change model for analysis of stages of change data, Multivariate Behavioral Research 33, 427-455.

Examples

Run this code
# NOT RUN {
library("mixor")
data("norcag")
# random intercepts model assuming proportional odds for differences in item responses
Fitted.norcag<-mixor(SexItems~Item2vs1+Item3vs1, data=norcag, id=ID, 
     weights=freq, link="logit", nAGQ=20)
summary(Fitted.norcag)
# random intercepts model assuming non-proportional odds for differences in item responses
Fitted.norcag.np<-mixor(SexItems~Item2vs1+Item3vs1, data=norcag, id=ID, 
     weights=freq, link="logit", nAGQ=10, KG=2)
summary(Fitted.norcag.np)
# SCALING model 
Fitted.norcag.scale<-mixor(SexItems~Item2vs1+Item3vs1, data=norcag, id=ID, 
     weights=freq, link="logit", nAGQ=10, KS=2)
summary(Fitted.norcag.scale)
# }

Run the code above in your browser using DataLab