expData-methods: Methods for expanded datasets

Description Usage Arguments Details See Also Examples

Description

Regression weights, residuals and residual plots for expanded datasets.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## S3 method for class 'expData'
residuals(object, ...)

## S3 method for class 'expData'
residualPlot(object, ...)

## S3 method for class 'expData'
residualPlots(object, ...)

## S3 method for class 'expData'
weights(object, ...)

Arguments

object

an expanded dataset (of class "expData").

...

additional arguments.

Details

weights extracts regression weights (to be used in the natural effect model) for each observation of an expanded dataset.

residuals extracts residuals from the working model which is stored as an attribute of the expanded dataset. These can be used to assess normality of the residuals of the mediator working model when using the weighting-based approach (see example).

residualPlot and residualPlots are convenience functions from the car package. These can be used to assess the adequacy of the working model.

See Also

expData, neWeight, residualPlot, residualPlots, residuals, weights

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
data(UPBdata)

weightData <- neWeight(negaff ~ att + gender + educ + age, 
                       data = UPBdata, nRep = 2)

## extract regression weights for natural effect model
head(weights(weightData)) 

## assess normality
qqnorm(residuals(weightData))

## assess model adequacy
library(car)
residualPlots(weightData)


Search within the medflex package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.