Gen_design_variables: Generate design variables

Description Usage Arguments Details Value Examples

View source: R/Generatepop.R

Description

Generate design variables

Usage

1
Gen_design_variables(N, Q, p, K_q = sample(2:p, Q, replace = T))

Arguments

N

population size

Q

Number of design variables

p

maximum number of levels for design variables, >=2.

Details

Generates X, Stratum indicator, computes N_j's and model matrix.

Value

a list of 10 elements. the element named Xd contains one line per individual and gives the value of the stratification variables as well as the stratum number for each individual. The element named vars gives the names of the stratification variables The element named Q gives the number of stratification variables The element named K_q gives for each stratification variable, the number of possible values The element N_j gives the count per stratum The element named Strata is a matrix with one line per stratum and contains the stratum identifier (column "Strata") as well as the corresponding values of the stratification variables.

Examples

1
2
N=1000;Q=2;p=5
XX<-Gen_design_variables(N,Q,p)

DanielBonnery/SimuTrangucci documentation built on Feb. 29, 2020, 7:05 p.m.