svyolr.Rd
Fits cumulative link models: proportional odds, probit, complementary log-log, and cauchit.
svyolr(formula, design, ...)
# S3 method for survey.design2
svyolr(formula, design, start, subset=NULL,..., na.action = na.omit, method = c("logistic",
"probit", "cloglog", "cauchit"))
# S3 method for svyrep.design
svyolr(formula,design,subset=NULL,...,return.replicates=FALSE,
multicore=getOption("survey.multicore"))
# S3 method for svyolr
predict(object, newdata, type = c("class", "probs"), ...)
Formula: the response must be a factor with at least three levels
survey design object
subset of the design to use; NULL
for all of it
dots
Optional starting values for optimization
handling of missing values
Use multicore
package to distribute computation of replicates across multiple
processors?
Link function
return the individual replicate-weight estimates
object of class svyolr
new data for predictions
return vector of most likely class or matrix of probabilities
An object of class svyolr
data(api)
dclus1<-svydesign(id=~dnum, weights=~pw, data=apiclus1, fpc=~fpc)
dclus1<-update(dclus1, mealcat=cut(meals,c(0,25,50,75,100)))
m<-svyolr(mealcat~avg.ed+mobility+stype, design=dclus1)
m
#> Call:
#> svyolr(mealcat ~ avg.ed + mobility + stype, design = dclus1)
#>
#> Coefficients:
#> avg.ed mobility stypeH stypeM
#> -2.6999217 0.0325042 -1.7574715 -0.6191463
#>
#> Intercepts:
#> (0,25]|(25,50] (25,50]|(50,75] (50,75]|(75,100]
#> -8.857919 -6.586464 -4.924938
## Use regTermTest for testing multiple parameters
regTermTest(m, ~avg.ed+stype, method="LRT")
#> Working (Rao-Scott+F) LRT for avg.ed stype
#> in svyolr(formula = mealcat ~ avg.ed + mobility + stype, design = dclus1)
#> Working 2logLR = 0.6580304 p= 0.73257
#> (scale factors: 2.7 0.22 0.11 ); denominator df= 10
## predictions
summary(predict(m, newdata=apiclus2))
#> (0,25] (25,50] (50,75] (75,100]
#> 51 46 16 13
summary(predict(m, newdata=apiclus2, type="probs"))
#> (0,25] (25,50] (50,75] (75,100]
#> Min. :0.004597 Min. :0.004944 Min. :0.0004632 Min. :0.0001086
#> 1st Qu.:0.096088 1st Qu.:0.153546 1st Qu.:0.0353593 1st Qu.:0.0086690
#> Median :0.334762 Median :0.330429 Median :0.1326655 Median :0.0374619
#> Mean :0.400508 Mean :0.307402 Mean :0.1658904 Mean :0.1262000
#> 3rd Qu.:0.691551 3rd Qu.:0.465418 3rd Qu.:0.2877986 3rd Qu.:0.1555944
#> Max. :0.994485 Max. :0.513732 Max. :0.3927702 Max. :0.8091764