margin_of_error: Calculate some estimates of the margin of error for weighted...

Description Usage Arguments Details Value Examples

Description

Calculate some estimates of the margin of error for weighted survey results

Usage

1
2
3
margin_of_error(inputfile, response)

margin_of_error_(inputfile, response_col)

Arguments

inputfile

A file containing the weighted survey data (a survey data frame with post-stratification weights, such as those created by weight_wwc). There must be a column weight or weight_best in the file. Either a path to a file, a connection, or literal data (either a single string or a raw vector). Files starting with http://, https://, ftp://, or ftps:// will be automatically downloaded, and zipped files wll be uncompressed.

response

A column in inputfile that contains the quantity to be weighted, such as the response to a yes/no question as in simulate_survey

response_col

Response column as string

Details

margin_of_error is given bare names while margin_of_error_ is given strings and is therefore suitable for programming with.

Value

A list with

Examples

1
2
margin_of_error(system.file("extdata/weightedsurvey.csv", package = "WWC"),
    response)

heathermkrause/WWC documentation built on May 17, 2019, 3:20 p.m.