eive.cga.formula | R Documentation |
Performs CGA based errors-in-variables correction for given formula and data. A single independent variable is supposed to be measured subject to error.
eive.cga.formula(formula, data, dirtyx.varname, numdummies = 10, popsize = 20)
formula |
Formula object. |
data |
data.frame that holds the regression data. |
dirtyx.varname |
String key value of the erroneous independent variable. |
numdummies |
Number of dummy variables used in auxiliary regression. |
popsize |
Population size parameter for compact genetic algorithm. 1/popsize is the mutation rate. |
A list() of regression equations.
ols
lm object calculated using original values
eive
lm object calculated using the predicted variable by eive
proxy
lm object of proxy regression obtained by genetic search.
cleanedx
Error-free estimate of the x variable (dirtyx) that is measured with error.
measurementerror
Estimate of the measurement error.
eive.cga
set.seed(12345)
n <- 30
clean_x <- rnorm(n, mean = 10, sd = sqrt(7))
delta_x <- rnorm(n, mean = 0, sd = sqrt(3))
e <- rnorm(n, mean = 0, sd = sqrt(5))
y <- 20 + 10 * clean_x + e
dirty_x <- clean_x + delta_x
mydata <- data.frame(y = y, dirtyx = dirty_x)
result <- eive.cga.formula(
formula = y ~ dirtyx,
dirtyx.varname = "dirtyx",
data = mydata,
numdummies = 10
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.