logic: Logic Error

Description Usage Arguments Examples

Description

Intended to enter values of two variable that shouldnt occure at the same time. This kind of error occurs when structural zeros occure. A structural zero happens in cases where it is impossible for the certain choice to be made. For example someone who has says no to having sex then says yes to having sex in the past month.

Usage

1
logic(data, phi, var_choice)

Arguments

data

The data that you want to give missing values to

phi

the probability that a row will have a logic error. Can enter a single number or an array of numbers to give weight to certian observations.

var_choice

Enter the two variables and their value that can never happen at the same time.

EX: error<-("gamm = 100, norm = 100") As of now its critical to include the spaces verbatum to the example. Currently in the works to fix this.

Examples

1
2
3
4
5
#phi as a single number
df <- data.frame(gamm=round(rgamma(1000, 3),0), norm=round(rnorm(1000,5), 0), pois=round(rpois(1000,2), 2))
error <- ("gamm = 100, norm = 100")

df_with_error <- LOGIC(df, .5, error )

JerryTucay/mfdata documentation built on May 7, 2019, 6:56 p.m.