Calculates estimates, standard errors and confidence intervals for ratios between totals in subpopulations.
1 2 3
Object of class
Formula defining the numerator variables for the ratio estimator.
Formula defining the denominator variables for the ratio estimator.
Formula specifying the variables that define the "estimation domains". If
Probability specifying the desired confidence level: the default value is
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
den) identifies the variables whose totals appear as the numerator (denominator) in the ratio estimator: the corresponding formula must be of the type
den=~den1+...+denl). The function calculates estimates for ratios between homologous variables in
den contain a different number of variables the shortest argument will be tacitly recycled. The
deskott variables referenced by
den) must be
numeric and must not contain any missing value (
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
deskott variables referenced by
by (if any) must be
factor and must not contain any missing value (
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.
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).
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
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.
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.
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.