Calculates estimates, standard errors and confidence intervals for regression coefficients in subpopulations.

kott.regcoef(deskott, model, by = NULL,
             vartype = c("se", "cv", "cvpct", "var"),
             conf.int = FALSE, conf.lev = 0.95)

Arguments

deskott

Object of class kott.design containing the replicated survey data.

model

Formula giving a symbolic description of the linear model.

by

Formula specifying the variables that define the "estimation domains". If NULL (the default option) estimates refer to the whole population.

vartype

character vector specifying the desired variability estimators. It is possible to choose one or more of: standard error (the default), coefficient of variation, percent coefficient of variation, or variance.

conf.int

Boolean (logical) value to request confidence intervals for the estimates: the default is FALSE.

conf.lev

Probability specifying the desired confidence level: the default value is 0.95.

Details

This function calculates weighted estimates of linear regression coefficients using suitable weights depending on the class of deskott: calibrated weights for class kott.cal.design and direct weights otherwise. Standard errors are calculated using the extended DAGJK method [Kott 99-01].

The mandatory argument model specifies, by means of a symbolic formula, the linear regression model whose coefficients are to be estimated. model must have the form response ~ terms where response is the (numeric) response variable and terms represents a series of terms which specifies a linear predictor for response. Variables referenced by model must not contain any missing value (NA).

The optional argument by specifies the variables that define the "estimation domains", that is the subpopulations for which the estimates are to be calculated. If by=NULL (the default option), the estimates produced by kottby refer to the whole population. Estimation domains must be defined by a formula: for example the statement by=~B1:B2 selects as estimation domains the subpopulations determined by crossing the modalities of variables B1 and B2. The deskott variables referenced by by (if any) must be factor and must not contain any missing value (NA).

The conf.int argument allows to request the confidence intervals for the estimates. By default conf.int=FALSE, that is the confidence intervals are not provided.

Whenever confidence intervals are requested (i.e. conf.int=TRUE), the desired confidence level can be specified by means of the conf.lev argument. The conf.lev value must represent a probability (0<=conf.lev<=1) and its default is chosen to be 0.95. Given an input kott.design object with nrg random groups and a regression model with p predictors plus an intercept term, kott.regcoef builds the confidence intervals making use of a t distribution with nrg-p-1 degrees of freedom.

Value

The return value depends on the value of the input parameters. In the most general case, the function returns an object of class list (typically a list made up of data frames).

References

Kott, Phillip S. (1999) "The Extended Delete-A-Group Jackknife". Bulletin of the International Statistical Instititute. 52nd Session. Contributed Papers. Book 2, pp. 167-168.

Kott, Phillip S. (2001) "The Delete-A-Group Jackknife". Journal of Official Statistics, Vol.17, No.4, pp. 521-526.

See also

kottby for estimating totals and means, kott.ratio for estimating ratios between totals, kott.quantile for estimating quantiles and kottby.user for calculating estimates based on user-defined estimators.

Examples

data(data.examples) # Creation of a kott.design object: kdes<-kottdesign(data=example,ids=~towcod+famcod,strata=~SUPERSTRATUM, weights=~weight,nrg=15) # A model with one predictor and no intercept: kott.regcoef(kdes,income~z-1)
#> estimate SE #> z 8.063845 0.09283493
# ...compare with ratio estimator: kott.ratio(kott.addvars(kdes,income.mult.z=income*z,z2=z^2),~income.mult.z,~z2)
#> estimate SE #> income.mult.z/z2 8.063845 0.09283493
# A model with a factor term and no intercept: kott.regcoef(kdes,income~age5c-1)
#> estimate SE #> age5c1 962.6162 17.790894 #> age5c2 1147.0752 11.174404 #> age5c3 1331.9582 8.119008 #> age5c4 1527.8775 23.573687 #> age5c5 1706.9270 60.304251
# ...compare with mean estimator in subpopulations: kottby(kdes,~income,~age5c,estimator="mean")
#> 1 2 3 4 5 #> mean 962.6162 1147.075 1331.958 1527.878 1706.927 #> SE 17.79089 11.1744 8.119008 23.57369 60.30425
# ...and with regression coefficients (for a different model) # in subpopulations: kott.regcoef(kdes,income~1,~age5c)
#> $`1` #> estimate SE #> (Intercept) 962.6162 17.79089 #> #> $`2` #> estimate SE #> (Intercept) 1147.075 11.1744 #> #> $`3` #> estimate SE #> (Intercept) 1331.958 8.119008 #> #> $`4` #> estimate SE #> (Intercept) 1527.878 23.57369 #> #> $`5` #> estimate SE #> (Intercept) 1706.927 60.30425 #>
# An awkward model with many coefficients: kott.regcoef(kdes,income~z:age5c+x3+marstat-1)
#> estimate SE #> x3 -26.4598653 45.5689296 #> marstatmarried 1275.2751880 23.4866361 #> marstatunmarried 1273.3780559 33.7613844 #> marstatwidowed 1266.3902809 29.3825100 #> z:age5c1 -2.0351565 0.2241651 #> z:age5c2 -0.8296368 0.1835013 #> z:age5c3 0.3388394 0.1667535 #> z:age5c4 1.6676810 0.2892248 #> z:age5c5 2.8991834 0.4560705