Learn R Programming

unga (version 0.1.0)

table_unga: A function for cross tabulation.

Description

Produces multiple prop.tables of a data frame. Extract questions with a specified number of response alternatives.

Usage

table_unga(qalt, sumopt, expvar, x)

Arguments

qalt

Number of response alternatives in a survey question

sumopt

Options for summation of proportions questions with 5 or 6 response alternatives, argument can be 1 or 2

expvar

Explanatory variable in your data frame, use numeric values

x

is a data frame

Value

the output from print

References

Norman M. Bradburn et al. 2004. Asking questions. 2nd revised edition. John Wiley & Sons

Examples

Run this code
# NOT RUN {
set.seed(123456)
gender<-round(runif(50,1,2))
variable_1<-round(runif(50,1,5))
variable_2<-round(runif(50,1,5))
variable_3<-round(runif(50,1,5))
df<-data.frame(gender,variable_1,variable_2,variable_3)
table_unga(5,1,gender,df)
# }

Run the code above in your browser using DataLab