diff --git a/data/survey/apiclus1.rda b/data/survey/apiclus1.rda new file mode 100644 index 0000000..9b489a1 Binary files /dev/null and b/data/survey/apiclus1.rda differ diff --git a/data/survey/apiclus2.rda b/data/survey/apiclus2.rda new file mode 100644 index 0000000..5cffc96 Binary files /dev/null and b/data/survey/apiclus2.rda differ diff --git a/data/survey/apipop.rda b/data/survey/apipop.rda new file mode 100644 index 0000000..c8043d7 Binary files /dev/null and b/data/survey/apipop.rda differ diff --git a/data/survey/apisrs.rda b/data/survey/apisrs.rda new file mode 100644 index 0000000..3fbbd90 Binary files /dev/null and b/data/survey/apisrs.rda differ diff --git a/data/survey/apistrat.rda b/data/survey/apistrat.rda new file mode 100644 index 0000000..26e67a9 Binary files /dev/null and b/data/survey/apistrat.rda differ diff --git a/data/survey/crowd.rda b/data/survey/crowd.rda new file mode 100644 index 0000000..9da3c33 Binary files /dev/null and b/data/survey/crowd.rda differ diff --git a/data/survey/election.rda b/data/survey/election.rda new file mode 100644 index 0000000..568ccd4 Binary files /dev/null and b/data/survey/election.rda differ diff --git a/data/survey/fpc.rda b/data/survey/fpc.rda new file mode 100644 index 0000000..a1a7baa Binary files /dev/null and b/data/survey/fpc.rda differ diff --git a/data/survey/hospital.rda b/data/survey/hospital.rda new file mode 100644 index 0000000..3feb9f7 Binary files /dev/null and b/data/survey/hospital.rda differ diff --git a/data/survey/mu284.rda b/data/survey/mu284.rda new file mode 100644 index 0000000..fa26123 Binary files /dev/null and b/data/survey/mu284.rda differ diff --git a/data/survey/myco.rda b/data/survey/myco.rda new file mode 100644 index 0000000..aaeac33 Binary files /dev/null and b/data/survey/myco.rda differ diff --git a/data/survey/nhanes.rda b/data/survey/nhanes.rda new file mode 100644 index 0000000..5d7e917 Binary files /dev/null and b/data/survey/nhanes.rda differ diff --git a/data/survey/salamander.rda b/data/survey/salamander.rda new file mode 100644 index 0000000..d7fae5e Binary files /dev/null and b/data/survey/salamander.rda differ diff --git a/data/survey/scd.rda b/data/survey/scd.rda new file mode 100644 index 0000000..d58b743 Binary files /dev/null and b/data/survey/scd.rda differ diff --git a/data/survey/yrbs.rda b/data/survey/yrbs.rda new file mode 100644 index 0000000..f1de3a2 Binary files /dev/null and b/data/survey/yrbs.rda differ diff --git a/doc/datasets.csv b/doc/datasets.csv index b8081be..37b29d6 100644 --- a/doc/datasets.csv +++ b/doc/datasets.csv @@ -684,6 +684,21 @@ "sem","Klein","Klein's Data on the U. S. Economy",22,10 "sem","Kmenta","Partly Artificial Data on the U. S. Economy",20,5 "sem","Tests","Six Mental Tests",32,6 +"survey","apiclus1","Student performance in California schools, Cluster Sample of School Districts",183,39 +"survey","apiclus2","Student performance in California schools, Two-Stage Cluster Sample of Schools",126,40 +"survey","apipop","Student performance in California schools, Entire Population",6194,37 +"survey","apisrs","Student performance in California schools, Simple Random Sample",200,39 +"survey","apistrat","Student performance in California schools, Stratified Sample",200,39 +"survey","crowd","Household crowding",6,5 +"survey","election","US 2004 presidential election data at state or county level",4600,8 +"survey","fpc","Small survey example",8,6 +"survey","hospital","Sample of obstetric hospitals",15,6 +"survey","mu284","Two-stage sample from MU284",15,5 +"survey","myco","Association between leprosy and BCG vaccination",516,6 +"survey","nhanes","Cholesterol data from a US survey",8591,7 +"survey","salamander","Salamander mating data set from McCullagh and Nelder (1989)",360,4 +"survey","scd","Survival in cardiac arrest",6,4 +"survey","yrbs","One variable from the Youth Risk Behaviors Survey, 2015.",15624,4 "survival","bladder","Bladder Cancer Recurrences",340,7 "survival","cancer","NCCTG Lung Cancer Data",228,10 "survival","cgd","Chronic Granulotomous Disease data",203,16 diff --git a/doc/packages.csv b/doc/packages.csv index 011d6ad..f457641 100644 --- a/doc/packages.csv +++ b/doc/packages.csv @@ -31,5 +31,6 @@ "rpart","Recursive Partitioning and Regression Trees" "sandwich","Robust Covariance Matrix Estimators" "sem","Structural Equation Models" +"survey","Analysis of Complex Survey Samples" "survival","Survival Analysis" "vcd","Visualizing Categorical Data" diff --git a/doc/survey/crowd.html b/doc/survey/crowd.html new file mode 100644 index 0000000..d5f0d01 --- /dev/null +++ b/doc/survey/crowd.html @@ -0,0 +1,81 @@ +R: Household crowding + + + + + + +
+ +
crowdR Documentation
+ +

Household crowding

+ +

Description

+ +

A tiny dataset from the VPLX manual. +

+ + +

Usage

+ +
data(crowd)
+ + +

Format

+ +

A data frame with 6 observations on the following 5 variables. +

+ +
+
rooms

Number of rooms in the house

+
+
person

Number of people in the household

+
+
weight

Sampling weight

+
+
cluster

Cluster number

+
+
stratum

Stratum number

+
+
+ + + +

Source

+ +

Manual for VPLX, Census Bureau. +

+ + +

Examples

+ +
data(crowd)
+
+## Example 1-1
+i1.1<-as.svrepdesign(svydesign(id=~cluster, weight=~weight,data=crowd))
+i1.1<-update(i1.1, room.ratio=rooms/person,
+overcrowded=factor(person>rooms))
+svymean(~rooms+person+room.ratio,i1.1)
+svytotal(~rooms+person+room.ratio,i1.1)
+svymean(~rooms+person+room.ratio,subset(i1.1,overcrowded==TRUE))
+svytotal(~rooms+person+room.ratio,subset(i1.1,overcrowded==TRUE))
+
+## Example 1-2
+i1.2<-as.svrepdesign(svydesign(id=~cluster,weight=~weight,strata=~stratum, data=crowd))
+svymean(~rooms+person,i1.2)
+svytotal(~rooms+person,i1.2)
+
+
+ +
+ +
+ diff --git a/doc/survey/election.html b/doc/survey/election.html new file mode 100644 index 0000000..e2619cd --- /dev/null +++ b/doc/survey/election.html @@ -0,0 +1,110 @@ +R: US 2004 presidential election data at state or county level + + + + + + +
+ +
electionR Documentation
+ +

US 2004 presidential election data at state or county level

+ +

Description

+ +

A sample of voting data from US states or counties (depending on data +availability), sampled with probability proportional to number of votes. The sample was drawn using Tille's splitting method, implemented in the "sampling" package. +

+ + +

Usage

+ +
data(election)
+ + +

Format

+ +

election is a data frame with 4600 observations on the following 8 variables. +

+ +
+
County

A factor specifying the state or country

+
+
TotPrecincts

Number of precincts in the state or county

+
+
PrecinctsReporting

Number of precincts supplying data

+
+
Bush

Votes for George W. Bush

+
+
Kerry

Votes for John Kerry

+
+
Nader

Votes for Ralph Nader

+
+
votes

Total votes for those three candidates

+
+
p

Sampling probability, proportional to votes

+
+
+ +

election_pps is a sample of 40 counties or states taken with +probability proportional to the number of votes. It includes the +additional column wt with the sampling weights. +

+

election_insample indicates which rows of election were sampled. +

+

election_jointprob are the pairwise sampling probabilities and +election_jointHR are approximate pairwise sampling probabilities using +the Hartley-Rao approximation. +

+ + +

Source

+ +

. +

+ + +

Examples

+ +
data(election)
+## high positive correlation between totals
+plot(Bush~Kerry,data=election,log="xy")
+## high negative correlation between proportions
+plot(I(Bush/votes)~I(Kerry/votes), data=election)
+
+## Variances without replacement
+## Horvitz-Thompson type
+dpps_br<- svydesign(id=~1,  fpc=~p, data=election_pps, pps="brewer")
+dpps_ov<- svydesign(id=~1,  fpc=~p, data=election_pps, pps="overton")
+dpps_hr<- svydesign(id=~1,  fpc=~p, data=election_pps, pps=HR(sum(election$p^2)/40))
+dpps_hr1<- svydesign(id=~1, fpc=~p, data=election_pps, pps=HR())
+dpps_ht<- svydesign(id=~1,  fpc=~p, data=election_pps, pps=ppsmat(election_jointprob))
+## Yates-Grundy type
+dpps_yg<- svydesign(id=~1,  fpc=~p, data=election_pps, pps=ppsmat(election_jointprob),variance="YG")
+dpps_hryg<- svydesign(id=~1,  fpc=~p, data=election_pps, pps=HR(sum(election$p^2)/40),variance="YG")
+
+## The with-replacement approximation
+dppswr <-svydesign(id=~1, probs=~p, data=election_pps)
+
+svytotal(~Bush+Kerry+Nader, dpps_ht)
+svytotal(~Bush+Kerry+Nader, dpps_yg)
+svytotal(~Bush+Kerry+Nader, dpps_hr)
+svytotal(~Bush+Kerry+Nader, dpps_hryg)
+svytotal(~Bush+Kerry+Nader, dpps_hr1)
+svytotal(~Bush+Kerry+Nader, dpps_br)
+svytotal(~Bush+Kerry+Nader, dpps_ov)
+svytotal(~Bush+Kerry+Nader, dppswr)
+
+ +
+ +
+ diff --git a/doc/survey/fpc.html b/doc/survey/fpc.html new file mode 100644 index 0000000..51ffe55 --- /dev/null +++ b/doc/survey/fpc.html @@ -0,0 +1,112 @@ +R: Small survey example + + + + + + +
+ +
fpcR Documentation
+ +

Small survey example

+ +

Description

+ +

The fpc data frame has 8 rows and 6 columns. It is artificial +data to illustrate survey sampling estimators. +

+ + +

Usage

+ +
data(fpc)
+ + +

Format

+ +

This data frame contains the following columns: +

+ +
+
stratid

Stratum ids

+
+
psuid

Sampling unit ids

+
+
weight

Sampling weights

+
+
nh

number sampled per stratum

+
+
Nh

population size per stratum

+
+
x

data

+
+
+ + + +

Source

+ +

⁠https://www.stata-press.com/data/r7/fpc.dta⁠ +

+ + +

Examples

+ +
data(fpc)
+fpc
+
+
+withoutfpc<-svydesign(weights=~weight, ids=~psuid, strata=~stratid, variables=~x, 
+   data=fpc, nest=TRUE)
+
+withoutfpc
+svymean(~x, withoutfpc)
+
+withfpc<-svydesign(weights=~weight, ids=~psuid, strata=~stratid,
+fpc=~Nh, variables=~x, data=fpc, nest=TRUE)
+
+withfpc
+svymean(~x, withfpc)
+
+## Other equivalent forms 
+withfpc<-svydesign(prob=~I(1/weight), ids=~psuid, strata=~stratid,
+fpc=~Nh, variables=~x, data=fpc, nest=TRUE)
+
+svymean(~x, withfpc)
+
+withfpc<-svydesign(weights=~weight, ids=~psuid, strata=~stratid,
+fpc=~I(nh/Nh), variables=~x, data=fpc, nest=TRUE)
+
+svymean(~x, withfpc)
+
+withfpc<-svydesign(weights=~weight, ids=~interaction(stratid,psuid),
+strata=~stratid, fpc=~I(nh/Nh), variables=~x, data=fpc)
+
+svymean(~x, withfpc)
+
+withfpc<-svydesign(ids=~psuid, strata=~stratid, fpc=~Nh,
+ variables=~x,data=fpc,nest=TRUE)
+
+svymean(~x, withfpc)
+
+withfpc<-svydesign(ids=~psuid, strata=~stratid,
+fpc=~I(nh/Nh), variables=~x, data=fpc, nest=TRUE)
+
+svymean(~x, withfpc)
+
+
+
+
+ +
+ +
+ diff --git a/doc/survey/hospital.html b/doc/survey/hospital.html new file mode 100644 index 0000000..f32730a --- /dev/null +++ b/doc/survey/hospital.html @@ -0,0 +1,81 @@ +R: Sample of obstetric hospitals + + + + + + +
+ +
hospitalR Documentation
+ +

Sample of obstetric hospitals

+ +

Description

+ +

The hospital data frame has 15 rows and 5 columns. +

+ + +

Usage

+ +
data(hospital)
+ + +

Format

+ +

This data frame contains the following columns: +

+ +
+
hospno

Hospital id

+
+
oblevel

level of obstetric care

+
+
weighta

Weights, as given by the original reference

+
+
tothosp

total hospitalisations

+
+
births

births

+
+
weightats

Weights, as given in the source

+
+
+ + + +

Source

+ +

Previously at ⁠http://www.ats.ucla.edu/stat/books/sop/hospsamp.dta⁠ +

+ + +

References

+ +

Levy and Lemeshow. "Sampling of Populations" (3rd edition). Wiley. +

+ + +

Examples

+ +
data(hospital)
+hospdes<-svydesign(strata=~oblevel, id=~hospno, weights=~weighta,
+fpc=~tothosp, data=hospital)
+hosprep<-as.svrepdesign(hospdes)
+
+svytotal(~births, design=hospdes)
+svytotal(~births, design=hosprep)
+
+
+ +
+ +
+ diff --git a/doc/survey/mu284.html b/doc/survey/mu284.html new file mode 100644 index 0000000..c7efc0a --- /dev/null +++ b/doc/survey/mu284.html @@ -0,0 +1,74 @@ +R: Two-stage sample from MU284 + + + + + + +
+ +
mu284R Documentation
+ +

Two-stage sample from MU284

+ +

Description

+ +

The MU284 population comes from Sarndal et al, and the complete data are +available from Statlib. These data are a two-stage sample from the +population, analyzed on page 143 of the book. +

+ + +

Usage

+ +
data(mu284)
+ + +

Format

+ +

A data frame with 15 observations on the following 5 variables. +

+ +
+
id1

identifier for PSU

+
+
n1

number of PSUs in population

+
+
id2

identifier for second-stage unit

+
+
y1

variable to be analysed

+
+
n2

number of second-stage units in this PSU

+
+
+ + + +

Source

+ +

Carl Erik Sarndal, Bengt Swensson, Jan Wretman. (1991) "Model Assisted +Survey Sampling" Springer. +

+

(downloaded from StatLib, which is no longer active) +

+ + +

Examples

+ +
data(mu284)
+(dmu284<-svydesign(id=~id1+id2,fpc=~n1+n2, data=mu284))
+(ytotal<-svytotal(~y1, dmu284))
+vcov(ytotal)
+
+ +
+ +
+ diff --git a/doc/survey/myco.html b/doc/survey/myco.html new file mode 100644 index 0000000..3e868c0 --- /dev/null +++ b/doc/survey/myco.html @@ -0,0 +1,98 @@ +R: Association between leprosy and BCG vaccination + + + + + + +
+ +
mycoR Documentation
+ +

+Association between leprosy and BCG vaccination +

+ +

Description

+ +

These data are in a paper by JNK Rao and colleagues, on score tests +for complex survey data. External information (not further specified) suggests +the functional form for the Age variable. +

+ + +

Usage

+ +
data("myco")
+ + +

Format

+ +

A data frame with 516 observations on the following 6 variables. +

+ +
+
Age

Age in years at the midpoint of six age strata

+
+
Scar

Presence of a BCG vaccination scar

+
+
n

Sampled number of cases (and thus controls) in the age stratum

+
+
Ncontrol

Number of non-cases in the population

+
+
wt

Sampling weight

+
+
leprosy

case status 0/1

+
+
+ + + +

Details

+ +

The data are a simulated stratified case-control study drawn from a +population study conducted in a region of Malawi (Clayton and Hills, +1993, Table 18.1). The goal was to examine whether BCG vaccination against +tuberculosis protects against leprosy (the causative agents are both species of +_Mycobacterium_). Rao et al have a typographical error: the number of +non-cases in the population in the 25-30 age stratum is given as 4981 +but 5981 matches both the computational output and the data as given by Clayton +and Hills. +

+ + +

Source

+ +

JNK Rao, AJ Scott, and Skinner, C. (1998). QUASI-SCORE TESTS WITH SURVEY +DATA. Statistica Sinica, 8(4), 1059-1070. +

+

Clayton, D., & Hills, M. (1993). Statistical Models in Epidemiology. OUP +

+ + +

Examples

+ +
data(myco)
+dmyco<-svydesign(id=~1, strata=~interaction(Age,leprosy),weights=~wt,data=myco)
+
+m_full<-svyglm(leprosy~I((Age+7.5)^-2)+Scar, family=quasibinomial, design=dmyco)
+m_age<-svyglm(leprosy~I((Age+7.5)^-2), family=quasibinomial, design=dmyco)
+anova(m_full,m_age)
+
+## unweighted model does not match
+m_full
+glm(leprosy~I((Age+7.5)^-2)+Scar, family=binomial, data=myco)
+
+
+ +
+ +
+ diff --git a/doc/survey/nhanes.html b/doc/survey/nhanes.html new file mode 100644 index 0000000..5e813db --- /dev/null +++ b/doc/survey/nhanes.html @@ -0,0 +1,76 @@ +R: Cholesterol data from a US survey + + + + + + +
+ +
nhanesR Documentation
+ +

+Cholesterol data from a US survey +

+ +

Description

+ +

Data extracted from NHANES 2009-2010 on high cholesterol. +

+ + +

Usage

+ +
data(nhanes)
+ + +

Format

+ +

A data frame with 8591 observations on the following 7 variables. +

+ +
+
SDMVPSU

Primary sampling units

+
+
SDMVSTRA

Sampling strata

+
+
WTMEC2YR

Sampling weights

+
+
HI_CHOL

Numeric vector: 1 for total cholesterol over +240mg/dl, 0 under 240mg/dl

+
+
race

1=Hispanic, 2=non-Hispanic white, 3=non-Hispanic +black, 4=other

+
+
agecat

Age group (0,19] (19,39] (39,59] (59,Inf]

+
+
RIAGENDR

Gender: 1=male, 2=female

+
+
+ + + +

Source

+ +

Previously at ⁠https://wwwn.cdc.gov/nchs/nhanes/search/datapage.aspx?Component=laboratory&CycleBeginYear=2009⁠ +

+ + +

Examples

+ +
data(nhanes)
+design <- svydesign(id=~SDMVPSU, strata=~SDMVSTRA, weights=~WTMEC2YR, nest=TRUE,data=nhanes)
+design
+
+ +
+ +
+ diff --git a/doc/survey/salamander.html b/doc/survey/salamander.html new file mode 100644 index 0000000..abd9bff --- /dev/null +++ b/doc/survey/salamander.html @@ -0,0 +1,85 @@ +R: Salamander mating data set from McCullagh and Nelder (1989) + + + + + + +
+ +
salamanderR Documentation
+ +

Salamander mating data set from McCullagh and Nelder (1989)

+ +

Description

+ +

This data set presents the outcome of three experiments +conducted at the University of Chicago in 1986 to study interbreeding +between populations of mountain dusky salamanders (McCullagh and +Nelder, 1989, Section 14.5). The analysis here is from Lumley (1998, +section 5.3)

+ + +

Usage

+ +
data(salamander)
+ + +

Format

+ +

A data frame with the following columns: +

+ +
+
Mate

Whether the salamanders mated (1) or did not mate (0).

+
+
Cross

Cross between female and male type. A factor with four levels: R/R,R/W,W/R, and W/W. The type of the female salamander is listed first and the male is listed second. Rough Butt is represented by R and White Side is represented by W. For example, Cross=W/R indicates a White Side female was crossed with a Rough Butt male.

+
+
Male

Identification number of the male salamander. A factor.

+
+
Female

Identification number of the female salamander. A factor.

+
+
+ + + +

References

+ +

McCullagh P. and Nelder, J. A. (1989) Generalized +Linear Models. Chapman and Hall/CRC. +Lumley T (1998) PhD thesis, University of Washington +

+ + +

Examples

+ +
data(salamander)
+salamander$mixed<-with(salamander, Cross=="W/R" | Cross=="R/W")
+salamander$RWvsWR<-with(salamander,  ifelse(mixed,
+          ((Cross=="R/W")-(Cross=="W/R"))/2,
+          0))
+xsalamander<-xdesign(id=list(~Male, ~Female), data=salamander,
+    overlap="unbiased")
+
+## Adjacency matrix
+## Blocks 1 and 2 are actually the same salamanders, but
+## it's traditional to pretend they are independent.
+image(xsalamander$adjacency)
+
+## R doesn't allow family=binomial(identity)
+success <- svyglm(Mate~mixed+RWvsWR, design=xsalamander,
+    family=quasi(link="identity", variance="mu(1-mu)"))
+summary(success)
+
+ +
+ +
+ diff --git a/doc/survey/scd.html b/doc/survey/scd.html new file mode 100644 index 0000000..adcd84b --- /dev/null +++ b/doc/survey/scd.html @@ -0,0 +1,101 @@ +R: Survival in cardiac arrest + + + + + + +
+ +
scdR Documentation
+ +

Survival in cardiac arrest

+ +

Description

+ +

These data are from Section 12.2 of Levy and Lemeshow. They describe +(a possibly apocryphal) study of survival in out-of-hospital cardiac +arrest. Two out of five ambulance stations were sampled from each of +three emergency service areas. +

+ + +

Usage

+ +
data(scd)
+ + +

Format

+ +

This data frame contains the following columns: +

+ +
+
ESA

Emergency Service Area (strata)

+
+
ambulance

Ambulance station (PSU)

+
+
arrests

estimated number of cardiac arrests

+
+
alive

number reaching hospital alive

+
+
+ + + +

Source

+ +

Levy and Lemeshow. "Sampling of Populations" (3rd edition). Wiley. +

+ + +

Examples

+ +
data(scd)
+
+## survey design objects
+scddes<-svydesign(data=scd, prob=~1, id=~ambulance, strata=~ESA,
+nest=TRUE, fpc=rep(5,6))
+scdnofpc<-svydesign(data=scd, prob=~1, id=~ambulance, strata=~ESA,
+nest=TRUE)
+
+# convert to BRR replicate weights
+scd2brr <- as.svrepdesign(scdnofpc, type="BRR")
+# or to Rao-Wu bootstrap
+scd2boot <- as.svrepdesign(scdnofpc, type="subboot")
+
+# use BRR replicate weights from Levy and Lemeshow
+repweights<-2*cbind(c(1,0,1,0,1,0), c(1,0,0,1,0,1), c(0,1,1,0,0,1),
+c(0,1,0,1,1,0))
+scdrep<-svrepdesign(data=scd, type="BRR", repweights=repweights)
+
+# ratio estimates
+svyratio(~alive, ~arrests, design=scddes)
+svyratio(~alive, ~arrests, design=scdnofpc)
+svyratio(~alive, ~arrests, design=scd2brr)
+svyratio(~alive, ~arrests, design=scd2boot)
+svyratio(~alive, ~arrests, design=scdrep)
+
+# or a logistic regression
+summary(svyglm(cbind(alive,arrests-alive)~1, family=quasibinomial, design=scdnofpc))
+summary(svyglm(cbind(alive,arrests-alive)~1, family=quasibinomial, design=scdrep))
+
+# Because no sampling weights are given, can't compute design effects
+# without replacement: use deff="replace"
+
+svymean(~alive+arrests, scddes, deff=TRUE)
+svymean(~alive+arrests, scddes, deff="replace")
+
+
+ +
+ +
+ diff --git a/doc/survey/yrbs.html b/doc/survey/yrbs.html new file mode 100644 index 0000000..6ea2925 --- /dev/null +++ b/doc/survey/yrbs.html @@ -0,0 +1,87 @@ +R: One variable from the Youth Risk Behaviors Survey, 2015. + + + + + + +
+ +
yrbsR Documentation
+ +

+One variable from the Youth Risk Behaviors Survey, 2015. +

+ +

Description

+ +

Design information from the Youth Risk Behaviors Survey (YRBS), together +with the single variable ‘Never/Rarely wore bike helmet’. Used as an +analysis example by CDC. +

+ + +

Usage

+ +
data("yrbs")
+ + +

Format

+ +

A data frame with 15624 observations on the following 4 variables. +

+ +
+
weight

sampling weights

+
+
stratum

sampling strata

+
+
psu

primary sampling units

+
+
qn8

1=Yes, 2=No

+
+
+ + + +

Source

+ +

https://ftp.cdc.gov/pub/Data/YRBS/2015smy/ for files +

+ + +

References

+ +

Centers for Disease Control and Prevention (2016) Software for Analysis +of YRBS Data. [CRAN doesn't believe the URL is valid] +

+ + +

Examples

+ +
data(yrbs)
+
+yrbs_design <- svydesign(id=~psu, weight=~weight, strata=~stratum,
+data=yrbs)
+yrbs_design <- update(yrbs_design, qn8yes=2-qn8)
+
+ci <- svyciprop(~qn8yes, yrbs_design, na.rm=TRUE, method="xlogit")
+ci
+
+## to print more digits: matches SUDAAN and SPSS exactly, per table 3 of reference
+coef(ci)
+SE(ci)
+attr(ci,"ci")
+
+ +
+ +
+