Description Usage Arguments Details Value Examples
Wrapper function for GSC estimation
1 2 3 |
dta |
A data frame |
dep.var |
A string defining the dependent variable |
indep.var |
A vector of strings defining the independent (treatment) variables |
b.init |
An initial value for the treatment variable coefficients. Must have same length as 'indep.var' |
method |
The GSC iteration method to be used. Must be one of:
|
sol.it |
The first step solution used in the two-step methods. If omitted, a new one-step solution is computed. |
wt.init |
An initial value for the weighting matrix |
print.level |
The level of detail provided in the printed output |
g.i |
A function defining a restriction on the parameters. Used in hypothesis testing. |
g.i.grad |
The gradient of |
... |
Other arguments to be passed to the optimization |
See the vignette "Using pgsc
" for an extended example.
Returns the point estimate of the model as a gsc
object, a list with entries:
The point estimate of the coefficients on the dependent variables
The difference between successive iterations
The maximum error on the within-iteration optimization problems
Number of iterations require to solve
The unit-specific MSEs from the solution
The "full" weighting matrix for counterfactuals, containing own-unit weights (all zero) and unit-N weights
The "minimal" weighting matrix, omitting own-unit weights and weights on unit N (which can be computed as one-minus-rowsum)
1 2 3 4 5 6 7 8 | data("pgsc.dta")
sol <- pgsc(pgsc.dta, dep.var = 'y', indep.var = c('D1','D2'),
b.init = c(0,0), method='onestep' )
summary(sol)
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 = sol$b, method='onestep', g.i=g.i, g.i.grad=g.i.grad )
summary(sol.r)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.