pgsc.wald.test {pgsc} | R Documentation |
A wrapper for the wald test of a restricted solution
pgsc.wald.test(dta, dep.var, indep.var, sol.rest, n.boot = 10000, seed = 42)
dta |
A dataframe |
dep.var |
A vector of strings of names of dependent variables. |
indep.var |
A vector of strings of names of independent (treatment) variables. |
sol.rest |
A restricted solution which is being tested |
n.boot |
The number of bootstrapped samples for the variance calculation. Default is 10000. |
seed |
Randomization seed. Default is 42. |
See the vignette "Using pgsc
" for an extended example.
Returns the wald test as gsc.wald
object, a list with entries:
The point estimate of the coefficients on the dependent variables
The Wald statistic
The bootstrapped Wald statistic
The p-value for the Wald statistic.
data("pgsc.dta") g.i <- function(b) b[1] ; g.i.grad <- function(b) c(1,0) sol.r <- pgsc(pgsc.dta, dep.var = 'y', indep.var = c('D1','D2'), b.init = c(0,1), method='onestep', g.i=g.i, g.i.grad=g.i.grad ) wald <- pgsc.wald.test( pgsc.dta, 'y', indep.var = c('D1','D2'), sol.r ) summary(wald) plot(wald)