Description Usage Format References Examples
Dataset to test the package.
1 |
A data frame with 432 observations on the following 63 variables.
weekA numeric vector. Response (week of arrest after release)
arrestA numeric vector. Censoring indicator (1 = case, Study time: one year)
finA numeric vector. Indicator for financial support.
ageA numeric vector. Age in years.
raceA numeric vector. Race (1=black, 0=white).
wexpA numeric vector. Indicator for work experience prior to arrest.
marA numeric vector. Indicator for married person.
paroA numeric vector. Indicator for parolee.
prioA numeric vector. Number of previous convictions.
educA numeric vector. Lebel of education (Scala 2-6 increasing)
emp152 numeric vectors. 0 = no work, 1 = work
emp2A numeric vector.
emp3A numeric vector.
emp4A numeric vector.
emp5A numeric vector.
emp6A numeric vector.
emp7A numeric vector.
emp8A numeric vector.
emp9A numeric vector.
emp10A numeric vector.
emp11A numeric vector.
emp12A numeric vector.
emp13A numeric vector.
emp14A numeric vector.
emp15A numeric vector.
emp16A numeric vector.
emp17A numeric vector.
emp18A numeric vector.
emp19A numeric vector.
emp20A numeric vector.
emp21A numeric vector.
emp22A numeric vector.
emp23A numeric vector.
emp24A numeric vector.
emp25A numeric vector.
emp26A numeric vector.
emp27A numeric vector.
emp28A numeric vector.
emp29A numeric vector.
emp30A numeric vector.
emp31A numeric vector.
emp32A numeric vector.
emp33A numeric vector.
emp34A numeric vector.
emp35A numeric vector.
emp36A numeric vector.
emp37A numeric vector.
emp38A numeric vector.
emp39A numeric vector.
emp40A numeric vector.
emp41A numeric vector.
emp42A numeric vector.
emp43A numeric vector.
emp44A numeric vector.
emp45A numeric vector.
emp46A numeric vector.
emp47A numeric vector.
emp48A numeric vector.
emp49A numeric vector.
emp50A numeric vector.
emp51A numeric vector.
emp52A numeric vector.
n.work.weeksA numeric vector. Number of weeks with work.
Fox, John. An R and S-PLUS Companion to Applied Regression, Sage Publications, 2002.
http://cran.r-project.org/doc/contrib/Fox-Companion/scripts.html
Rossi, P., R. Berk, and K. Lenihan (1980). Money, work, and crime: experimental evidence. Quantitative studies in social relations. Academic Press.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 | ## Not run:
### prepares the dataset 'Rossi' for the package 'GlobalDeviance'
setwd(...)
Rossi<-read.table("Rossi.txt", header=TRUE)
Rossi$n.work.weeks<-rowSums(Rossi[, grepl("emp[0-90-9]", names(Rossi))], na.rm=TRUE)
save(Rossi, file="Rossi.rda")
### load dataset 'Rossi'
data(Rossi)
str(Rossi)
names(Rossi)
# Covariables (patients x covariables)
model.dat<-Rossi[, c("arrest", "fin", "wexp")]
str(model.dat)
# data (variables/genes x patients)
xx<-rbind(t(t(t(Rossi[, c("prio", "n.work.weeks")]))), rpois(432, 1))
rownames(xx)<-c("prio", "n.work.weeks", "random")
formula.full<- ~ arrest + fin + wexp
formula.red<- ~ arrest + fin
test.vars<-list("prio", "n.work.weeks", "random", c("prio", "n.work.weeks"),
c("prio", "n.work.weeks", "random"))
names(test.vars)<-c("prio", "n.work.weeks", "random", "prio+n.work.weeks",
"prio+n.work.weeks+random")
set.seed(54321)
t.rossi1<-expr.dev.test(xx=xx, formula.full=formula.full, formula.red=formula.red,
model.dat=model.dat, test.vars=test.vars, glm.family=poisson(link="log"),
perm=100, method="permutation", cf="fisher")
t.rossi2<-expr.dev.test(xx=xx, formula.full=formula.full, formula.red=formula.red,
model.dat=model.dat, test.vars=test.vars, glm.family=poisson(link="log"),
perm=100, method="chisqstat", cf="fisher")
summary(t.rossi1, digits=2)
summary(t.rossi2, digits=3)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.