buildFrameDF.Rd
This function allows to build the information regarding the sampling frame of the population of reference. Mandatory variables are: (i) the name of the dataset containing the sampling frame of the population of reference (ii) an identifier (Id) (iii) a set of auxiliary variables X (iv) a set of target variables Y (v) the indicator of the domain to which the unit belongs A further optional parameter is the the name of the variable containing weights (in case instead of a frame we use a sampling survey)
buildFrameDF(df, id, X, Y, domainvalue)
df | This is the name of the dataframe containing the information on all the units in population of reference. |
---|---|
id | This is the name of the identifier in the sampling frame. |
X | A character vector containing the names of the auxiliary variables in the frame dataset |
Y | A character vector containing the names of the target variables in the frame dataset |
domainvalue | The name of the variable in the frame dataset that contains the indication of the domains to which the units belong. |
weight | The name of the variable in the frame dataset that contains the weights (in case we do not use a proper frame, but a sampling survey. |
A dataframe
Giulio Barcaroli
if (FALSE) { data(swissmunicipalities) id = "Nom" X = c("Surfacesbois","Surfacescult") Y = c("Pop020","Pop2040") domainvalue = "REG" frame <- buildFrameDF(swissmunicipalities,id,X,Y,domainvalue) head(frame) }