create_binomial: Creates a success/failure column for each IA based on counts.

Description Usage Arguments Value Examples

View source: R/calculations.R

Description

create_binomial uses interest area count columns to create a success/failure column for each IA which is suitable for logistic regression. N.B.: This function will work for data with a maximum of 8 interest areas.

Usage

1
2
3
4
5
6
7
create_binomial(
  data,
  NoIA = NULL,
  ObsPerBin = NULL,
  ObsOverride = FALSE,
  CustomBinom = NULL
)

Arguments

data

A data table object output by either bin_prop or transform_to_elogit.

NoIA

A positive integer indicating the number of interest areas defined when creating the study.

ObsPerBin

A positive integer indicating the number of observations to use in the calculation. Typically, this will be the number of samples per bin, which can be determined with check_samples_per_bin.

ObsOverride

A logical value controlling restrictions on the value provided to ObsPerBin. Default value is FALSE.

CustomBinom

An optional parameter specifying a vector containing two integers corresponding to the interest area IDs to be combined.

Value

A data table with additional columns (the number of which depends on the number of interest areas specified) added to data.

Examples

1
2
3
4
5
6
## Not run: 
library(VWPre)
# Create binomial (success/failure) column...
df <- create_binomial(data = dat, NoIA = 4, ObsPerBin = 20)

## End(Not run)

VWPre documentation built on Nov. 30, 2020, 1:08 a.m.