kott.ratio: Estimation of ratios between totals

Description Usage Arguments Details Value Warning Author(s) References See Also Examples

Description

Calculates estimates, standard errors and confidence intervals for ratios between totals in subpopulations.

Usage

1
2
3
kott.ratio(deskott, num, den, 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.

num

Formula defining the numerator variables for the ratio estimator.

den

Formula defining the denominator variables for the ratio estimator.

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 for ratios between totals of quantitative variables 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 num (den) identifies the variables whose totals appear as the numerator (denominator) in the ratio estimator: the corresponding formula must be of the type
num=~num1+...+numk (den=~den1+...+denl). The function calculates estimates for ratios between homologous variables in num and den; if num and den contain a different number of variables the shortest argument will be tacitly recycled. The deskott variables referenced by num (den) must be numeric and 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, kott.ratio builds the confidence intervals making use of a t distribution with nrg-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).

Warning

It is possible that, in certain subpopulations, the estimate of the total of some den variables turns out to be zero for the original sample in deskott and/or for some of its nrg replicates. In these cases, kott.ratio (i) returns NaN for the estimates and/or for the corresponding standard errors and (ii) prints a warning message.

Author(s)

Diego Zardetto

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.quantile for estimating quantiles, kott.regcoef for estimating regression coefficients and kottby.user for calculating estimates based on user-defined estimators.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
data(data.examples)

# Creation of a kott.design object:
kdes<-kottdesign(data=example,ids=~towcod+famcod,strata=~SUPERSTRATUM,
      weights=~weight,nrg=15)

# Estimate of the ratios y1/x1, y2/x2 e y3/x3 by marstat:
kott.ratio(kdes,~y1+y2+y3,~x1+x2+x3,by=~marstat)

# Estimate of the ratios z/x1, z/x2 e z/x3
# for the whole population (notice the recycling rule):
kott.ratio(kdes,~z,~x1+x2+x3,conf.int=TRUE)

# Estimators of means can be thought as 
# ratio estimators:
kottby(kdes,~income,estimator="mean")  
kott.ratio(kott.addvars(kdes,population=1),num=~income,den=~population)

DiegoZardetto/EVER documentation built on April 8, 2021, 1:05 p.m.