UCLA Academic Technology Services HomeServicesClassesContactJobs
Help the Stat Consulting Group by giving a gift             
Loading

R Textbook Examples
Applied Longitudinal Data Analysis: Modeling Change and Event Occurrence
by Judith D. Singer and John B. Willett
Chapter 9: A framework for investigating event occurrence

The examples on the page were written in R version 2.4.1. 


Fig. 9.1 on page 321.

teachers<-read.table("http://www.ats.ucla.edu/stat/R/examples/alda/data/teachers.csv", sep=",", header=T)
attach(teachers)
t0<-teachers$t[censor==0]
t1<-teachers$t[censor==1]
par(mfrow=c(1, 2), mar=c(3, 3, 1, 1), cex=0.7)
h0<-hist(t0, breaks=c(0:12),  plot=FALSE)
h1<-hist(t1, breaks=c(0:12),  plot=FALSE)
plot(h0, labels=TRUE, col="darkgray", ylim=c(0, 500), main=" ")
plot(h1, labels=TRUE, ylim=c(0, 500), col="darkgray", main=" ", ylab="")


How to cite this page

Report an error on this page or leave a comment

UCLA Researchers are invited to our Statistical Consulting Services
We recommend others to our list of Other Resources for Statistical Computing Help
These pages are Copyrighted (c) by UCLA Academic Technology Services


The content of this web site should not be construed as an endorsement of any particular web site, book, or software product by the University of California