Learn R Programming

zoib (version 1.0)

AlcoholUse: California County-level Teenager Monthly Alcohol Use data

Description

AlcoholUse contains the county-level monthly alcohol use data from students in California in years 2008 to 2010. The data can be downloaded at http://www.kidsdata.org. The data has information on the percentage of public school students in grades 7, 9, and 11 in five buckets of days (0, 1-2, 3-9, 10-19, 20-30) in which they drank alcohol in the past 30 days. zoib is applied to examining whether the proportions of alhocol use in the past month are different across gender, grade, days of drinking.

Usage

data(AlcoholUse)

Arguments

source

http://www.kidsdata.org

Examples

Run this code
data("AlcoholUse", package = "zoib")
	AlcoholUse$Grade = as.factor(AlcoholUse$Grade)

  post.obj <- zoib(Percentage ~ Grade+Days+Gender|1|Grade+Days+Gender|1,
  data = AlcoholUse, random = 1, EUID= AlcoholUse$County,
  zero.inflation = TRUE,  one.inflation = FALSE, joint = FALSE, 
  n.iter=1000, n.thin=5)  
	post.sample <- post.obj$oripara 
	post.sample.c1<- post.sample[[1]][11:200,]
	post.sample.c2<- post.sample[[2]][11:200,]
	post.sample <- mcmc.list(as.mcmc(post.sample.c1),as.mcmc(post.sample.c2))
	summary(post.sample)

Run the code above in your browser using DataLab