Last data update: 2014.03.03

R: Predict Conditional Effects
elrPredictR Documentation

Predict Conditional Effects

Description

Predicts conditional treatment effects based on a fitted EffectLiteR model.

Usage

elrPredict(obj, newdata = NULL)

Arguments

obj

Object of class effectlite.

newdata

An optional data.frame, containing the same continuous and categorical covariates as used when fitting the EffectLiteR model in obj. Only covariates (and neither the dependent variable nor indicators for latent variables) should be included.

Value

Object of class "data.frame".

Examples

m1 <- effectLite(y="dv", z=c("z1"), k=c("k1","kateg2"), x="x", 
control="control", data=example01)
newdata <- data.frame(k1="male", kateg2="1", z1=2)
elrPredict(m1, newdata)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(EffectLiteR)
Loading required package: lavaan
This is lavaan 0.5-20
lavaan is BETA software! Please report any bugs.
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/EffectLiteR/elrPredict.Rd_%03d_medium.png", width=480, height=480)
> ### Name: elrPredict
> ### Title: Predict Conditional Effects
> ### Aliases: elrPredict
> 
> ### ** Examples
> 
> m1 <- effectLite(y="dv", z=c("z1"), k=c("k1","kateg2"), x="x", 
+ control="control", data=example01)
> newdata <- data.frame(k1="male", kateg2="1", z1=2)
> elrPredict(m1, newdata)
           g1     se_g1         g2     se_g2   Eygx0kz    Eygx1kz     Eygx2kz
1 -0.09468854 0.2482164 -0.2439777 0.2400799 0.1850225 0.09033393 -0.05895525
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>