Learn R Programming

sregsurvey (version 0.1.2)

sreg_pips: Semiparametric Model-Assisted Estimation under a Proportional to Size Sampling Design

Description

sreg_pips is used to estimate the total parameter of a finite population generated from a semi-parametric generalized gamma population under a proportional to size without-replacement sampling design.

Usage

sreg_pips(location_formula, scale_formula, data, x, n, ...)

Arguments

location_formula

a symbolic description of the systematic component of the location model to be fitted.

scale_formula

a symbolic description of the systematic component of the scale model to be fitted.

data

a data frame, list containing the variables in the model.

x

vector, an auxiliary variable to calculate the inclusion probabilities of each unit.

n

numeric, sample size.

...

further parameters accepted by caret and survey functions.

Value

sampling_design is the name of the sampling design used in the estimation process.

N is the population size.

n is the sample size used in the estimation process.

first_order_probabilities vector of the first order probabilities used in the estimation process.

sample is the random sample used in the estimation process.

estimated_total_y_sreg is the SREG estimate of the total parameter of the finite population.

References

Cardozo C.A, Alonso C. (2021) Semi-parametric model assisted estimation in finite populations. In preparation.

Cardozo C.A., Paula G., and Vanegas L. (2021). Generalized log-gamma semiparametric models with P-spline smoothing. Submitted.

Sarndal C.E., Swensson B., and Wretman J. (2003). Model Assisted Survey Sampling. Springer-Verlag.

Examples

Run this code
# NOT RUN {
library(sregsurvey)
library(survey)
library(dplyr)
library(gamlss)
data(api)
attach(apipop)
Apipop <- filter(apipop,full!= 'NA')
Apipop <- filter(Apipop, stype == 'H')
Apipop <- Apipop %>% dplyr::select(api00,grad.sch,full,api99)
n=ceiling(0.25*dim(Apipop)[1])
aux_var <- Apipop %>% dplyr::select(api99)
sreg_pips(api00 ~  pb(grad.sch), scale_formula = ~ full - 1, data= Apipop, x= aux_var, n=n)
# The total population value is
sum(Apipop$api00)
# }

Run the code above in your browser using DataLab