Example data frames and functions. Allow to run R code contained in the 'Examples' section of the EVER package help pages.

data(data.examples)

Format

The main data frame, named example, contains (artificial) data from a two stage stratified cluster sampling design. The sample is made up of 3000 final units, for which the following 21 variables were observed:

towcod

Code identifying "variance PSUs": towns (PSUs) in NSR strata, families (SSUs) in SR strata, numeric

famcod

Code identifying families (SSUs), numeric

key

Key identifying final units (individuals), numeric

weight

Initial weights, numeric

stratum

Stratification variable, factor with levels 801 802 803 901 902 903 904 905 906 907 908 1001 1002 1003 1004 1005 1006 1007 1008 1009 1101 1102 1103 1104 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3101 3102 3103 3104 3105 3106 3107 3108 3201 3202 3203 3204 5401 5402 5403 5404 5405 5406 5407 5408 5409 5410 5411 5412 5413 5414 5415 5416 5501 5502 5503 5504 9301 9302 9303 9304 9305 9306 9307 9308 9309 9310 9311 9312

SUPERSTRATUM

Collapsed strata variable (eliminates lonely PSUs), factor with levels 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55

sr

Strata type, integer with values 0 (NSR strata) and 1 (SR strata)

regcod

Code identifying regions, factor with levels 6 7 10

procod

Code identifying provinces, factor with levels 8 9 10 11 30 31 32 54 55 93

x1

Indicator variable (integer), numeric

x2

Indicator variable (integer), numeric

x3

Indicator variable (integer), numeric

y1

Indicator variable (integer), numeric

y2

Indicator variable (integer), numeric

y3

Indicator variable (integer), numeric

age5c

Age variable with 5 classes, factor with levels 1 2 3 4 5

age10c

Age variable with 10 classes, factor with levels 1 2 3 4 5 6 7 8 9 10

sex

Sex variable, factor with levels f m

marstat

Marital status variable, factor with levels married unmarried widowed

z

A continuous quantitative variable, numeric

income

Income variable, numeric

Details

Objects pop01, …, pop05p contain known population totals for various calibration models. Object pairs with names differing in the 'p' suffix (such as pop03 and pop03p) refer to the same calibration problem but pertain to different solution methods (global and iterative respectively, see kottcalibrate). The two-component numeric vector bounds expresses a possible choice for the allowed range for the ratios between calibrated weights and direct weights in the aforementioned calibration problems.

Functions ones, poverty and ratio are intended to show how to use kottby.user for calculating estimates, standard errors and confidence intervals for user-defined estimators.

Examples

data(data.examples)