smoothing | R Documentation |
The smoothing()
function implements three methods, all yielding refined estimates of either variance or effective sample size, to account for indicators with different variance functions. The output estimates are ready to be used as known parameters in an area-level model, and they need to be added to the analysed data.frame
object. All the implemented methods enable the estimation of the effective sample sizes, whereas "ols"
and "gls"
also perform a variance smoothing procedure.
smoothing(
data,
direct_estimates,
area_id = NULL,
raw_variance = NULL,
areas_sample_sizes = NULL,
additional_covariates = NULL,
method = c("ols", "gls", "kish"),
var_function = NULL,
survey_data = NULL,
survey_area_id = NULL,
weights = NULL,
sizes = NULL
)
data |
A |
direct_estimates |
Character string specifying the variable in |
area_id |
Character string indicating the variable with domain names included in |
raw_variance |
Character string indicating the variable name for raw variance estimates included in |
areas_sample_sizes |
Character string indicating the variable name for domain sample sizes included in |
additional_covariates |
A vector of character strings indicating the variable names of possible additional covariates, included in |
method |
The method to be used. The choices are |
var_function |
An object of class |
survey_data |
An additional dataset to be specified when method |
survey_area_id |
Character string indicating the variable denoting the domain names included in the |
weights |
Character string indicating the variable including sampling weights in |
sizes |
Character string indicating the variable including unit sizes in |
An object of class smoothing_fitsae
, being a list of vectors including dispersion estimates: the variances and, when no alternative variance functions are specified, the effective sample sizes. When "ols"
or "gls"
method has been selected, the list incorporates also an object of class gls
from nlme
package.
kish1992weightingtipsae
\insertReffabrizi2011hierarchicaltipsae
\insertRefJSStipsae
gls
for details on estimation procedure for "ols"
and "gls"
methods.
library(tipsae)
# loading toy dataset
data("emilia_cs")
# perform smoothing procedure
smoo <- smoothing(emilia_cs, direct_estimates = "hcr", area_id = "id",
raw_variance = "vars", areas_sample_sizes = "n",
var_function = NULL, method = "ols")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.