emxRegressionModel: Create a regression model

View source: R/emxModelBuilders.R

emxRegressionModelR Documentation

Create a regression model

Description

This function creates a regression model as an MxModel object.

Usage

emxRegressionModel(model, data, type='Steven', run, ...)
emxModelRegression(model, data, type='Steven', run, ...)

Arguments

model

formula. See Details.

data

data used for the model

run

logical. Whether to run the model before returning.

type

character. Either 'Steven' or 'Joshua'. See Details.

...

Further named arguments to be passed to lm for the formula

Details

The model argument is a formula identical to what is used in lm.

The type argument switches the kind of regression model that is specified. When there are no missing data, the two versions will estimate the same regression parameters but type='Steven' will estimate addition parameters that are not estimated by type='Joshua'. The type='Steven' model is due to Steven Boker and many others. It estimates more parameters than a typical regression analysis and has a different set of assumptions. More exactly, type='Steven' models the outcome and all of the predictors as a multivariate Normal distribution. By contrast, type='Joshua' is due to Joshua Pritikin and exactly replicates the typical regression model with its usual assumptions. In particular, type='Joshua' models the regression residual as a univariate Normal distribution. Predictors are assumed to have no measurement error (see Westfall & Yarkoni, 2016).

The benefit of type='Steven' is that it handles missing data with full-information maximum likelihood (FIML; Enders & Bandalos, 2001), at the cost of using a different model with different assumptions from ordinary least squares regression. The benefit of type='Joshua' is that it exactly replicates regression as a maximum likelhood model, at the cost of having the same weakness in terms of missing data as OLS regression.

Value

An MxModel.

References

Enders, C. K. & Bandalos, D. L. (2001). The relative performance of full information maximum likelihood estimation for missing data in structural equation models. <i>Structural Equation Modeling, 8</i>(3), 430-457.

Westfall, J. & Yarkoni, T. (2016). Statistically controlling for confounding constructs is harder than you think. <i>PLoS ONE, 11</i>(3). doi:10.1371/journal.pone.0152719

See Also

lm

Examples

   
# Example
require(EasyMx)
data(myRegDataRaw)
myrdr <- myRegDataRaw
myrdr[1, 4] <- NA

## Not run: 
run <- emxRegressionModel(y~1+x*z, data=myrdr, run=TRUE)
summary(run)

## End(Not run)

summary(lm(y~1+x*z, data=myrdr))




EasyMx documentation built on Feb. 16, 2023, 7:27 p.m.