create_binomial {VWPre} | R Documentation |
Creates a success/failure column for each IA based on counts.
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
create_binomial(
data,
NoIA = NULL,
ObsPerBin = NULL,
ObsOverride = FALSE,
CustomBinom = NULL
)
Arguments
data |
A data table object output by either |
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 |
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
## Not run:
library(VWPre)
# Create binomial (success/failure) column...
df <- create_binomial(data = dat, NoIA = 4, ObsPerBin = 20)
## End(Not run)