A systematic method for gathering information from a sample of entities for the purposes of constructing quantitative descriptors of the attributes of the larger population of which the entities are members
Sampling units - where information will be collected from Sampling frame - the set of sampling units containing distinct sets of population members
Surveys with complex sample designs will often have:
A weight is used to indicate the relative strength of an observation.
In the simplest case, each observation is counted equally.
For example, if we have five observations, and wish to calculate the mean, we just add up the values and divide by 5.
library(htmlTable)
y<-c(4,2,1,5,2)
wt<-c(1,2,4,1,2)
dat<-data.frame(y=y, weight=wt)
htmlTable(dat)
| y | weight | |
|---|---|---|
| 1 | 4 | 1 |
| 2 | 2 | 2 |
| 3 | 1 | 4 |
| 4 | 5 | 1 |
| 5 | 2 | 2 |
Unweighted sample mean
mean(dat$y)
## [1] 2.8
Weighted sample mean
library(questionr)
wtd.mean(x=dat$y, weights=dat$weight)
## [1] 2.1
With unweighted data, each case is counted equally.
Unweighted data represent only those in the sample who provide data.
With weighted data, each case is counted relative to its representation in the population.
Weights allow analyses that represent the target population.
Weights compensate for collecting data from a sample rather than the entire population and for using a complex sample design.
Weights adjust for differential selection probabilities and reduce bias associated with non-response by adjusting for differential nonresponse. Weights are used when estimating characteristics of the population.
Standard errors are produced for estimates from sample surveys. They are a measure of the variance in the estimates associated with the selected sample being one of many possible samples.
Standard errors are used to test hypotheses and to study group differences.
Using inaccurate standard errors can lead to identification of statistically significant results where none are present and vice versa
The usual standard error formula assumes a simple random sample.
Software packages designed for simple random samples tend to underestimate the standard errors for complex sample designs.
Standard errors for estimates from a complex sample must account for the within cluster/ across cluster variation.
Special software can make the adjustment, or this adjustment can be approximated using the design effect.
There are basically 3 ways in which software estiamtes variances: 1) Naive method 2) Taylor series approximation 3) Balanced or Jackknife replication
This example will cover the use of R functions for analyzing complex survey data. Most social and health surveys are not simple random samples of the population, but instead consist of respondents from a complex survey design.
These designs often stratify the population based on one or more characteristics, including geography, race, age, etc. In addition the designs can be multi-stage, meaning that initial strata are created, then respondents are sampled from smaller units within those strata.
An example would be if a school district was chosen as a sample strata, and then schools were then chosen as the primary sampling units (PSUs) within the district. From this 2 stage design, we could further sample classrooms within the school (3 stage design) or simply sample students (or whatever our unit of interest is).
Here’s a picture of this:
Multistage Sampling - From Kawachi and Berkman, 2003
A second feature of survey data we often want to account for is differential respondent weighting. This means that each respondent is given a weight to represent how common that particular respondent is within the population. This reflects the differenital probability of sampling based on respondent characteristics.
As demographers, we are also often interested in making inference for the population, not just the sample, so our results must be generalizable to the population at large. Sample weights are used in the process as well.
When such data are analyzed, we must take into account this nesting structure (sample design) as well as the respondent sample weight in order to make valid estimates of ANY statistical parameter. If we do not account for design, the parameter standard errors will be incorrect, and if we do not account for weighting, the parameters themselves will be incorrect and biased.
In general there are typically three things we need to find in our survey data codebooks: The sample strata identifier, the sample primary sampling unit identifier (often called a cluster identifier) and the respondent survey weight. These will typically have one of these names and should be easily identifiable in the codebook.
Statistical software will have special routines for analyzing these types of data and you must be aware that the diversity of statistical routines that generally exists will be lower for analyzing complex survey data, and some forms of analysis may not be available!
Below I illustrate the use of survey characteristics when conducting descriptive analysis of a survey data set and a linear regression model estimated from that data. For this example I am using 2016 CDC Behavioral Risk Factor Surveillance System (BRFSS) SMART metro area survey data. Link
#load brfss
library(car)
## Loading required package: carData
library(stargazer)
##
## Please cite as:
## Hlavac, Marek (2018). stargazer: Well-Formatted Regression and Summary Statistics Tables.
## R package version 5.2.2. https://CRAN.R-project.org/package=stargazer
library(survey)
## Loading required package: grid
## Loading required package: Matrix
## Loading required package: survival
##
## Attaching package: 'survey'
## The following object is masked from 'package:graphics':
##
## dotchart
library(questionr)
library(dplyr)
##
## Attaching package: 'dplyr'
## The following object is masked from 'package:car':
##
## recode
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
load("~/Google Drive/classes/dem7283/class_19_7283/data/brfss16_mmsa.Rdata")
#The names in the data are very ugly, so I make them less ugly
nams<-names(brfss16m)
head(nams, n=10)
## [1] "DISPCODE" "HHADULT" "GENHLTH" "PHYSHLTH" "MENTHLTH" "POORHLTH"
## [7] "HLTHPLN1" "PERSDOC2" "MEDCOST" "CHECKUP1"
#we see some names are lower case, some are upper and some have a little _ in the first position. This is a nightmare.
newnames<-tolower(gsub(pattern = "_",replacement = "",x = nams))
names(brfss16m)<-newnames
#Poor or fair self rated health
brfss16m$badhealth<-Recode(brfss16m$genhlth, recodes="4:5=1; 1:3=0; else=NA")
#sex
brfss16m$male<-ifelse(brfss16m$sex==1, 1, 0)
#race/ethnicity
brfss16m$black<-Recode(brfss16m$racegr3, recodes="2=1; 9=NA; else=0")
brfss16m$white<-Recode(brfss16m$racegr3, recodes="1=1; 9=NA; else=0")
brfss16m$other<-Recode(brfss16m$racegr3, recodes="3:4=1; 9=NA; else=0")
brfss16m$hispanic<-Recode(brfss16m$racegr3, recodes="5=1; 9=NA; else=0")
#insurance
brfss16m$ins<-Recode(brfss16m$hlthpln1, recodes ="7:9=NA; 1=1;2=0")
#income grouping
brfss16m$inc<-ifelse(brfss16m$incomg==9, NA, brfss16m$incomg)
#education level
brfss16m$educ<-Recode(brfss16m$educa, recodes="1:2='0Prim'; 3='1somehs'; 4='2hsgrad'; 5='3somecol'; 6='4colgrad';9=NA", as.factor=T)
brfss16m$educ<-relevel(brfss16m$educ, ref='2hsgrad')
#employment
brfss16m$employ<-Recode(brfss16m$employ1, recodes="1:2='Employed'; 2:6='nilf'; 7='retired'; 8='unable'; else=NA", as.factor=T)
brfss16m$employ<-relevel(brfss16m$employ, ref='Employed')
#marital status
brfss16m$marst<-Recode(brfss16m$marital, recodes="1='married'; 2='divorced'; 3='widowed'; 4='separated'; 5='nm';6='cohab'; else=NA", as.factor=T)
brfss16m$marst<-relevel(brfss16m$marst, ref='married')
#Age cut into intervals
brfss16m$agec<-cut(brfss16m$age80, breaks=c(0,24,39,59,79,99))
#BMI, in the brfss16ma the bmi variable has 2 implied decimal places, so we must divide by 100 to get real bmi's
brfss16m$bmi<-brfss16m$bmi5/100
brfss16m$obese<-ifelse(brfss16m$bmi>=30, 1, 0)
First, we will do some descriptive analysis, such as means and cross tabulations.
#First we will do some tables
#Raw frequencies
table(brfss16m$badhealth, brfss16m$educ)
##
## 2hsgrad 0Prim 1somehs 3somecol 4colgrad
## 0 47484 3008 6646 54755 92394
## 1 14612 2880 4434 11928 9222
#column percentages
prop.table(table(brfss16m$badhealth, brfss16m$educ), margin=2)
##
## 2hsgrad 0Prim 1somehs 3somecol 4colgrad
## 0 0.76468694 0.51086957 0.59981949 0.82112382 0.90924658
## 1 0.23531306 0.48913043 0.40018051 0.17887618 0.09075342
#basic chi square test of independence
chisq.test(table(brfss16m$badhealth, brfss16m$educ))
##
## Pearson's Chi-squared test
##
## data: table(brfss16m$badhealth, brfss16m$educ)
## X-squared = 14538, df = 4, p-value < 2.2e-16
So basically all of these numbers are incorrect, since they all assume random sampling. Now, we must tell R what the survey design is and what the weight variable is, then we can re-do these so they are correct.
Now we identify the survey design. ids = PSU identifers, strata=strata identifiers, weights=case weights, data= the data frame where these variables are located. Lastly, I only include respondents with NON-MISSING case weights.
I first try to get only cities in the state of Texas by looking for “TX” in the MSA’s name field in the data.
brfss16m$tx<-NA
brfss16m$tx[grep(pattern = "TX", brfss16m$mmsaname)]<-1
Now I make the survey design object
brfss16m<-brfss16m%>%
filter(tx==1, is.na(mmsawt)==F)
options(survey.lonely.psu = "adjust")
des<-svydesign(ids=~1, strata=~ststr, weights=~mmsawt, data = brfss16m )
Now , we re-do the analysis from above using only weights:
cat<-wtd.table(brfss16m$badhealth, brfss16m$educ, weights = brfss16m$mmsawt)
prop.table(wtd.table(brfss16m$badhealth, brfss16m$educ, weights = brfss16m$mmsawt), margin=2)
## 2hsgrad 0Prim 1somehs 3somecol 4colgrad
## 0 0.83817890 0.55863963 0.68087124 0.83855115 0.92229136
## 1 0.16182110 0.44136037 0.31912876 0.16144885 0.07770864
#compare that with the original
prop.table(table(brfss16m$badhealth, brfss16m$educ), margin=2)
##
## 2hsgrad 0Prim 1somehs 3somecol 4colgrad
## 0 0.7517539 0.4814815 0.5748219 0.7951509 0.8829225
## 1 0.2482461 0.5185185 0.4251781 0.2048491 0.1170775
There are differences, notably that the prevalence of poor SRH is higher in the sample than the population. This is important!
Let’s say we also want the standard errors of these percentages. This can be found for a proportion by: \(s.e. (p)={\sqrt {p(1-p)} \over {n}}\)
So we need to get n and p, that’s easy:
n<-table(is.na(brfss16m$badhealth)==F)
n
FALSE TRUE 55 8008
p<-prop.table(wtd.table(brfss16m$badhealth, brfss16m$educ, weights = brfss16m$mmsawt), margin=2)
se<-(p*(1-p))/n[2]
stargazer(data.frame(proportion=p, se=sqrt(se)), summary = F, type = "html", digits = 2)
| proportion.Var1 | proportion.Var2 | proportion.Freq | se.Var1 | se.Var2 | se.Freq | |
| 1 | 0 | 2hsgrad | 0.84 | 0 | 2hsgrad | 0.004 |
| 2 | 1 | 2hsgrad | 0.16 | 1 | 2hsgrad | 0.004 |
| 3 | 0 | 0Prim | 0.56 | 0 | 0Prim | 0.01 |
| 4 | 1 | 0Prim | 0.44 | 1 | 0Prim | 0.01 |
| 5 | 0 | 1somehs | 0.68 | 0 | 1somehs | 0.01 |
| 6 | 1 | 1somehs | 0.32 | 1 | 1somehs | 0.01 |
| 7 | 0 | 3somecol | 0.84 | 0 | 3somecol | 0.004 |
| 8 | 1 | 3somecol | 0.16 | 1 | 3somecol | 0.004 |
| 9 | 0 | 4colgrad | 0.92 | 0 | 4colgrad | 0.003 |
| 10 | 1 | 4colgrad | 0.08 | 1 | 4colgrad | 0.003 |
Which shows us the errors in the estimates based on the weighted proportions. That’s nice, but since we basically inflated the n to be the population of the US, these se’s are too small. This is another example of using survey statistical methods, to get the right se for a statistic.
#Now consider the full sample design + weights
cat<-svytable(~badhealth+educ, design = des)
stargazer(data.frame(prop.table(svytable(~badhealth+educ, design = des), margin = 2)),summary = F, type = "html", digits=3)
| badhealth | educ | Freq | |
| 1 | 0 | 2hsgrad | 0.838 |
| 2 | 1 | 2hsgrad | 0.162 |
| 3 | 0 | 0Prim | 0.559 |
| 4 | 1 | 0Prim | 0.441 |
| 5 | 0 | 1somehs | 0.681 |
| 6 | 1 | 1somehs | 0.319 |
| 7 | 0 | 3somecol | 0.839 |
| 8 | 1 | 3somecol | 0.161 |
| 9 | 0 | 4colgrad | 0.922 |
| 10 | 1 | 4colgrad | 0.078 |
Which gives the same %’s as the weighted table above, but we also want the correct standard errors for our bad health prevalences.
The svyby() function will calculate statistics by groups, in this case we want the % in bad health by each level of education. The %’s can be gotten using the svymean() function, which finds means of variables using survey design:
sv.table<-svyby(formula = ~badhealth, by = ~educ, design = des, FUN = svymean, na.rm=T)
stargazer(sv.table, summary = F, type = "html", digits = 2)
| educ | badhealth | se | |
| 2hsgrad | 2hsgrad | 0.16 | 0.02 |
| 0Prim | 0Prim | 0.44 | 0.06 |
| 1somehs | 1somehs | 0.32 | 0.04 |
| 3somecol | 3somecol | 0.16 | 0.02 |
| 4colgrad | 4colgrad | 0.08 | 0.01 |
And we see the same point estimates of our prevalences as in the simple weighted table, but the standard errors have now been adjusted for survey design as well, so they are also correct. You also see they are much larger than the ones we computed above, which assumed random sampling.
Next we apply this logic to a regression case. First we fit the OLS model for our BMI outcome using education and age as predictors:
fit1<-lm(bmi~educ+agec, data=brfss16m)
Next we incorporate case weights
fit2<-lm(bmi~educ+agec, data=brfss16m, weights = mmsawt)
Now we will incorporate design effects as well:
fit3<-svyglm(bmi~educ+agec,des, family=gaussian)
Now I make a table to show the results of the three models:
stargazer(fit1, fit2, fit3, style="demography", type="html",
column.labels = c("OLS", "Weights Only", "Survey"),
title = "Regression models for BMI using survey data - BRFSS 2016",
covariate.labels=c("PrimarySchool", "SomeHS", "SomeColl", "CollGrad", "Age 24-39","Age 39-59" ,"Age 59-79", "Age 80+"),
keep.stat="n", model.names=F, align=T, ci=T)
| bmi | |||
| OLS | Weights Only | Survey | |
| Model 1 | Model 2 | Model 3 | |
| PrimarySchool | 1.209** | 0.053 | 0.053 |
| (0.387, 2.030) | (-0.630, 0.737) | (-1.273, 1.379) | |
| SomeHS | 0.993** | 0.576* | 0.576 |
| (0.341, 1.645) | (0.038, 1.113) | (-0.655, 1.806) | |
| SomeColl | 0.118 | 0.137 | 0.137 |
| (-0.267, 0.502) | (-0.234, 0.508) | (-0.708, 0.982) | |
| CollGrad | -1.075*** | -1.878*** | -1.878*** |
| (-1.423, -0.727) | (-2.264, -1.492) | (-2.584, -1.172) | |
| Age 24-39 | 2.701*** | 2.542*** | 2.542*** |
| (1.958, 3.444) | (2.078, 3.007) | (1.469, 3.616) | |
| Age 39-59 | 3.954*** | 3.562*** | 3.562*** |
| (3.249, 4.658) | (3.110, 4.015) | (2.479, 4.646) | |
| Age 59-79 | 3.149*** | 3.108*** | 3.108*** |
| (2.463, 3.836) | (2.615, 3.602) | (1.989, 4.228) | |
| Age 80+ | 0.788* | 0.434 | 0.434 |
| (0.019, 1.557) | (-0.438, 1.306) | (-0.829, 1.698) | |
| Constant | 25.428*** | 25.939*** | 25.939*** |
| (24.746, 26.111) | (25.516, 26.362) | (24.920, 26.958) | |
| N | 7,448 | 7,448 | 7,448 |
| p < .05; p < .01; p < .001 | |||
Notice, the resuls for the education levels are much less significant than the were with either of the other two analysis. This is because those models had standard errors for the parameters that were too small. You see all the standard errors are larger and the T statistics are smaller.
Which shows the same \(\beta\)’s between the survey design model and the weighted model but the standard errors are larger in the survey model, so the test statistics are more conservative (smaller t statistics).
While in this simple model, our overall interpretation of the effects do not change (positive effects of education, negative effects of age), it is entirely possible that they could once we include our survey design effects.
It may be informative to plot the results of the models to see how different the coefficients are from one another:
library(ggplot2)
library(dplyr)
coefs<-data.frame(coefs=c(coef(fit1)[-1], coef(fit3)[-1]),
mod=c(rep("Non Survey Model", 8),rep("Survey Model", 8)),
effect=rep(names(coef(fit1)[-1]), 2))
coefs%>%
ggplot()+
geom_point(aes( x=effect, y=coefs, group=effect,color=effect, shape=mod),
position=position_jitterdodge(jitter.width = 1),
size=2)+
ylab("Regression Coefficient")+
xlab("Beta")+
geom_abline(intercept = 0, slope=0)+
theme(axis.text.x = element_text(angle = 45, hjust = 1))+
ggtitle(label = "Comparison of Survey and Non-Survey Regression effects")
Which shows us that the betas are similar but have some differences between the two models.
One of the coolest ways to use the BRFSS is to calculate estimates for places, and by demographic characteristics withing places. Again, we use svyby() to do this, but now we calculate obesity rates by sex within cities.
citytab<-svyby(~obese, ~mmsaname+male, design=des,FUN = svymean, na.rm=T )
stargazer(citytab, type="html", digits=3, summary = F, rownames = F)
| mmsaname | male | obese | se |
| Austin-Round Rock, TX, Metropolitan Statistical Area | 0 | 0.303 | 0.026 |
| College Station-Bryan, TX, Metropolitan Statistical Area | 0 | 0.263 | 0.095 |
| Corpus Christi, TX, Metropolitan Statistical Area | 0 | 0.490 | 0.082 |
| Dallas-Plano-Irving, TX, Metropolitan Division | 0 | 0.368 | 0.041 |
| El Paso, TX, Metropolitan Statistical Area | 0 | 0.332 | 0.037 |
| Fort Worth-Arlington, TX, Metropolitan Division | 0 | 0.341 | 0.045 |
| Houston-The Woodlands-Sugar Land, TX, Metropolitan Statistical Area | 0 | 0.282 | 0.031 |
| San Antonio-New Braunfels, TX, Metropolitan Statistical Area | 0 | 0.379 | 0.041 |
| Wichita Falls, TX, Metropolitan Statistical Area | 0 | 0.278 | 0.063 |
| Austin-Round Rock, TX, Metropolitan Statistical Area | 1 | 0.286 | 0.028 |
| College Station-Bryan, TX, Metropolitan Statistical Area | 1 | 0.289 | 0.094 |
| Corpus Christi, TX, Metropolitan Statistical Area | 1 | 0.267 | 0.072 |
| Dallas-Plano-Irving, TX, Metropolitan Division | 1 | 0.324 | 0.038 |
| El Paso, TX, Metropolitan Statistical Area | 1 | 0.353 | 0.044 |
| Fort Worth-Arlington, TX, Metropolitan Division | 1 | 0.269 | 0.043 |
| Houston-The Woodlands-Sugar Land, TX, Metropolitan Statistical Area | 1 | 0.307 | 0.030 |
| San Antonio-New Braunfels, TX, Metropolitan Statistical Area | 1 | 0.402 | 0.041 |
| Wichita Falls, TX, Metropolitan Statistical Area | 1 | 0.331 | 0.100 |
There’s a new package called srvyr that incorporates the survey analysis stuff into the dplyr universe:
brfsurv<-brfss16m%>%
as_survey_design(1,strata=ststr,weights=mmsawt )
library(srvyr)
brfsurv%>%
group_by(mmsaname,male)%>%
summarise(obprev = survey_mean(obese, na.rm=T))
If your dataset comes with replicate weights, you have to specify the survey design slightly differently. Here is an example using the IPUMS CPS data. For this data, you can get information here, but you must consult your specific data source for the appropriate information for your data.
load("~/Google Drive/classes/dem7283/class_19_7283//data/cpsmar10tx.Rdata")
names(cpsmar10tx)
## [1] "year" "serial" "hwtsupp" "repwt" "statefip" "metarea"
## [7] "foodstmp" "REPWT1" "REPWT2" "REPWT3" "REPWT4" "REPWT5"
## [13] "REPWT6" "REPWT7" "REPWT8" "REPWT9" "REPWT10" "REPWT11"
## [19] "REPWT12" "REPWT13" "REPWT14" "REPWT15" "REPWT16" "REPWT17"
## [25] "REPWT18" "REPWT19" "REPWT20" "REPWT21" "REPWT22" "REPWT23"
## [31] "REPWT24" "REPWT25" "REPWT26" "REPWT27" "REPWT28" "REPWT29"
## [37] "REPWT30" "REPWT31" "REPWT32" "REPWT33" "REPWT34" "REPWT35"
## [43] "REPWT36" "REPWT37" "REPWT38" "REPWT39" "REPWT40" "REPWT41"
## [49] "REPWT42" "REPWT43" "REPWT44" "REPWT45" "REPWT46" "REPWT47"
## [55] "REPWT48" "REPWT49" "REPWT50" "REPWT51" "REPWT52" "REPWT53"
## [61] "REPWT54" "REPWT55" "REPWT56" "REPWT57" "REPWT58" "REPWT59"
## [67] "REPWT60" "REPWT61" "REPWT62" "REPWT63" "REPWT64" "REPWT65"
## [73] "REPWT66" "REPWT67" "REPWT68" "REPWT69" "REPWT70" "REPWT71"
## [79] "REPWT72" "REPWT73" "REPWT74" "REPWT75" "REPWT76" "REPWT77"
## [85] "REPWT78" "REPWT79" "REPWT80" "REPWT81" "REPWT82" "REPWT83"
## [91] "REPWT84" "REPWT85" "REPWT86" "REPWT87" "REPWT88" "REPWT89"
## [97] "REPWT90" "REPWT91" "REPWT92" "REPWT93" "REPWT94" "REPWT95"
## [103] "REPWT96" "REPWT97" "REPWT98" "REPWT99" "REPWT100" "REPWT101"
## [109] "REPWT102" "REPWT103" "REPWT104" "REPWT105" "REPWT106" "REPWT107"
## [115] "REPWT108" "REPWT109" "REPWT110" "REPWT111" "REPWT112" "REPWT113"
## [121] "REPWT114" "REPWT115" "REPWT116" "REPWT117" "REPWT118" "REPWT119"
## [127] "REPWT120" "REPWT121" "REPWT122" "REPWT123" "REPWT124" "REPWT125"
## [133] "REPWT126" "REPWT127" "REPWT128" "REPWT129" "REPWT130" "REPWT131"
## [139] "REPWT132" "REPWT133" "REPWT134" "REPWT135" "REPWT136" "REPWT137"
## [145] "REPWT138" "REPWT139" "REPWT140" "REPWT141" "REPWT142" "REPWT143"
## [151] "REPWT144" "REPWT145" "REPWT146" "REPWT147" "REPWT148" "REPWT149"
## [157] "REPWT150" "REPWT151" "REPWT152" "REPWT153" "REPWT154" "REPWT155"
## [163] "REPWT156" "REPWT157" "REPWT158" "REPWT159" "REPWT160" "month"
## [169] "pernum" "wtsupp" "relate" "age" "sex" "race"
## [175] "marst" "offpov" "MIGRATE1"
cpsmar10tx$poverty<-ifelse(cpsmar10tx$offpov==1,1,0)
des2<-svrepdesign( data = cpsmar10tx,repweights = cpsmar10tx[, c(8:167)] , weights = ~wtsupp , type="JK1", scale=.025)
des2
## Call: svrepdesign.default(data = cpsmar10tx, repweights = cpsmar10tx[,
## c(8:167)], weights = ~wtsupp, type = "JK1", scale = 0.025)
## Unstratified cluster jacknife (JK1) with 160 replicates.
#Without design
prop.table(table(cpsmar10tx$poverty))
##
## 0 1
## 0.8374617 0.1625383
#with design
prop.table(svytable(~poverty, design = des2))
## poverty
## 0 1
## 0.8481106 0.1518894
#Again, using the mean
mean(cpsmar10tx$poverty)
## [1] 0.1625383
#Using the design. This would be an official estimate of poverty in TX in 2010:
svymean(~poverty, design=des2)
## mean SE
## poverty 0.15189 0.007
fit<-svyglm(poverty~cut(age, breaks = 5), des2, family=binomial)
summary(fit)
##
## Call:
## svyglm(formula = poverty ~ cut(age, breaks = 5), des2, family = binomial)
##
## Survey design:
## svrepdesign.default(data = cpsmar10tx, repweights = cpsmar10tx[,
## c(8:167)], weights = ~wtsupp, type = "JK1", scale = 0.025)
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -1.0512 0.1147 -9.163 2.88e-16 ***
## cut(age, breaks = 5)(29,43] -0.7178 0.1405 -5.109 9.39e-07 ***
## cut(age, breaks = 5)(43,57] -0.7677 0.1412 -5.436 2.07e-07 ***
## cut(age, breaks = 5)(57,71] -1.1828 0.1690 -7.000 7.28e-11 ***
## cut(age, breaks = 5)(71,85.1] -0.8162 0.2249 -3.629 0.000385 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 4239)
##
## Number of Fisher Scoring iterations: 4