Learn R Programming

multilevelPSA (version 1.2.5)

plot.mlpsa: Plots the results of a multilevel propensity score model.

Description

The plot created uses the ggplot2 framework. As such, additional modifications can be made. This plot is an extension of the circ.psa function in the PSAgraphics package for multilevel models.

Usage

# S3 method for mlpsa
plot(x, ratio = c(1, 2), plotExtra = NULL, ...)

Arguments

x

the results of mlpsa.

ratio

the ratio of the size of the distribution plots (left and bottom) to the circular plot.

plotExtra

a plot to place in the lower left corner.

...

parameters passed to mlpsa.circ.plot and mlpsa.distribution.plot

Examples

Run this code
# NOT RUN {
require(multilevelPSA)
require(party)
data(pisana)
data(pisa.colnames)
data(pisa.psa.cols)
mlctree = mlpsa.ctree(pisana[,c('CNT','PUBPRIV',pisa.psa.cols)], formula=PUBPRIV ~ ., level2='CNT')
student.party = getStrata(mlctree, pisana, level2='CNT')
student.party$mathscore = apply(student.party[,paste0('PV', 1:5, 'MATH')], 1, sum) / 5
results.psa.math = mlpsa(response=student.party$mathscore, 
       treatment=student.party$PUBPRIV, 
       strata=student.party$strata, 
       level2=student.party$CNT, minN=5)
plot(results.psa.math)
# }

Run the code above in your browser using DataLab