Description Usage Arguments Value See Also Examples
Loess plot with density distributions for propensity scores and outcomes on top and right, respectively.
1 2 3 4 5 6 | loess.plot(x, response, treatment, responseTitle = "",
treatmentTitle = "Treatment",
percentPoints.treat = 0.1,
percentPoints.control = 0.01, points.treat.alpha = 0.1,
points.control.alpha = 0.1, plot.strata,
plot.strata.alpha = 0.2, ...)
|
x |
vector of propensity scores. |
response |
the response variable. |
treatment |
the treatment varaible as a logical type. |
percentPoints.treat |
the percentage of treatment points to randomly plot. |
percentPoints.control |
the percentage of control points to randomly plot. |
points.treat.alpha |
the transparency level for treatment points. |
points.control.alpha |
the transparency level for control points. |
responseTitle |
the label to use for the y-axis (i.e. the name of the response variable) |
treatmentTitle |
the label to use for the treatment legend. |
plot.strata |
an integer value greater than 2 indicating the number of vertical lines to plot corresponding to quantiles. |
plot.strata.alpha |
the alpha level for the vertical lines. |
... |
other parameters passed to
|
a ggplot2 figure
plot.mlpsa
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | ## Not run:
require(multilevelPSA)
require(party)
data(pisana)
data(pisa.psa.cols)
cnt = 'USA' #Can change this to USA, MEX, or CAN
pisana2 = pisana[pisana$CNT == cnt,]
pisana2$treat <- as.integer(pisana2$PUBPRIV) %% 2
lr.results <- glm(treat ~ ., data=pisana2[,c('treat',pisa.psa.cols)], family='binomial')
st = data.frame(ps=fitted(lr.results),
math=apply(pisana2[,paste('PV', 1:5, 'MATH', sep='')], 1, mean),
pubpriv=pisana2$treat)
st$treat = as.logical(st$pubpriv)
loess.plot(st$ps, response=st$math, treatment=st$treat, percentPoints.control = 0.4,
percentPoints.treat=0.4)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.