help doseresponse, help doseresponse_model                      (SJ8-3: st0150)
-------------------------------------------------------------------------------

Title

doseresponse -- Estimation of the dose-response function through adjustment for the generalized propensity score

Syntax

doseresponse varlist [if] [in] [weight], outcome(varname) t(varname) gpscore(newvar) predict(newvar) sigma(newvar) cutpoints(varname) index(string) nq_gps(#) dose_response(newvarlist) [t_transf(transformation) normal_test(test) norm_level(#) test_varlist(varlist) test(type) flag(#) cmd(regression_cmd) reg_type_t(type) reg_type_gps(type) interaction(#) tpoints(vector) npoints(#) delta(#) filename(filename) bootstrap(string) boot_reps(#) analysis(string) analysis_level(#) graph(filename) detail]

doseresponse_model treat_var GPS_var [if] [in] [weight], outcome(varname) [cmd(regression_cmd) reg_type_t(type) reg_type_gps(type) interaction(#)]

fweights, iweights, and pweights are allowed; see weight.

Description

doseresponse estimates the generalized propensity score (GPS), verifies the normal model used for the GPS, and tests the balancing property by calling the routine gpscore. Then it estimates the conditional expectation of the outcome given the observed treatment and the estimated GPS by calling the routine doseresponse_model. Finally, doseresponse estimates the average potential outcome for each level of the treatment in which the user is interested.

doseresponse_model defines all these models and estimates each of them by using the estimated GPS.

Options

Required

outcome(varname) (doseresponse and doseresponse_model) specifies that varname is the outcome variable.

t(varname) specifies that varname is the treatment variable.

gpscore(newvar) specifies the variable name for the estimated GPS, which is added to the dataset.

predict(newvar) creates a new variable to hold the fitted values of the treatment variable.

sigma(newvar) creates a new variable to hold the maximum likelihood estimate of the conditional standard error of the treatment given the covariates.

cutpoints(varname) divides the set of potential treatment values into intervals according to the sample distribution of the treatment variable, cutting at varname quantiles.

index(string) specifies the representative point of the treatment variable at which the GPS has to be evaluated within each treatment interval. string identifies either the mean (string = mean) or a percentile (string = p1, ..., p100) of the treatment.

nq_gps(#) specifies that the values of the GPS evaluated at the representative point index(string) of each treatment interval have to be divided into # (1 <= # <= 100) intervals, defined by the quantiles of the GPS evaluated at the representative point index(string).

dose_response(newvarlist) specifies the variable name(s) for the estimated dose-response function(s).

Optional

t_transf(transformation) specifies the transformation of the treatment variable used in estimating the GPS. The default transformation is the identity function. The supported transformations are the logarithmic transformation, t_transf(ln); the zero-skewness log transformation, t_transf(lnskew0); the zero-skewness Box-Cox transformation, t_transf(bcskew0); and the Box-Cox transformation, t_transf(boxcox).

normal_test(test) specifies the goodness-of-fit test that gpscore will perform to assess the validity of the assumed normal distribution model for the treatment conditional on the covariates. By default, gpscore performs the Kolmogorov-Smirnov test (normal_test(ksmirnov)). Possible alternatives are the Shapiro-Francia test, normal_test(sfrancia); the Shapiro-Wilk test, normal_test(swilk); and the Stata skewness and kurtosis test for normality, normal_test(sktest).

norm_level(#) sets the significance level of the goodness-of-fit test for normality. The default is norm_level(0.05).

test_varlist(varlist) specifies that the extent of covariate balancing has to be inspected for each variable in varlist. The default varlist consists of the variables used to estimate the GPS. This option is useful when there are categorical variables among the covariates to test the balancing property for the omitted group.

test(type) specifies whether the balancing property has to be tested using a standard two-sided t test (the default) or a Bayes-factor-based method.

flag(#) specifies that gpscore estimates the GPS without performing either a goodness-of-fit test for normality or a balancing test. The default # is 1, meaning that both the normal distribution model and the balancing property are tested; the default level is recommended.

cmd(regression_cmd) (doseresponse and doseresponse_model) defines the regression command to be used for estimating the conditional expectation of the outcome given the treatment and the GPS. The default for the outcome variable is cmd(logit) when there are two distinct values, cmd(mlogit) when there are 3-5 values, and cmd(regress) otherwise. The supported regression commands are logit, probit, mlogit, mprobit, ologit, oprobit, and regress.

reg_type_t(type) (doseresponse and doseresponse_model) defines the maximum power of the treatment variable in the polynomial function used to approximate the predictor for the conditional expectation of the outcome given the treatment and the GPS. The default type is linear. Alternatively, type can be quadratic or cubic.

reg_type_gps(type) (doseresponse and doseresponse_model) defines the maximum power of the estimated GPS in the polynomial function used to approximate the predictor for the conditional expectation of the outcome given the treatment and the GPS. The default type is linear. Alternatively, type can be quadratic or cubic.

interaction(#) (doseresponse and doseresponse_model) specifies whether the model for the conditional expectation of the outcome given the treatment and the GPS has the interaction between treatment and GPS. The default # is 1, meaning that the interaction is included.

tpoints(vector) specifies that doseresponse estimates the average potential outcome for each level of the treatment in vector. By default, doseresponse creates a vector with the ith element equal to the ith observed treatment value. This option cannot be used with the npoints(#) option.

npoints(#) specifies that doseresponse estimates the average potential outcome for each level of the treatment belonging to a set of evenly spaced values t0, t1, ..., t#, that cover the range of the observed treatment. This option cannot be used with the tpoints(vector) option.

delta(#) specifies that doseresponse also estimates the treatment-effect function considering a #-treatment gap, which is defined as E[Y(t + #)] - E[Y(t)]. The default # is 0, meaning that doseresponse estimates only the dose-response function.

filename(filename) stores the treatment levels specified through the tpoints(vector) option or the npoints(#) option, the estimated dose-response function, and, eventually, the estimated treatment-effect function, along with their standard errors (if calculated), to a new file called filename.

bootstrap(string) specifies the use of bootstrap methods to derive standard errors and confidence intervals. By default, doseresponse does not apply bootstrap techniques. In such a case, no standard error is calculated. To activate this option, string should be set to yes.

boot_reps(#) specifies the number of bootstrap replications to be performed. The default is boot_reps(50). This option produces an effect only if the bootstrap() option is set to yes.

analysis(string) specifies that doseresponse plots the estimated dose-response function(s) and the estimated treatment-effect function(s), along with the corresponding confidence intervals if they are calculated with bootstrapping. By default, doseresponse plots only the estimated dose-response and treatment function(s). If the user types analysis(no), no plot is shown.

analysis_level(#) sets the confidence level of the confidence intervals. The default is analysis_level(0.95).

graph(filename) stores the plots of the estimated dose-response function and the estimated treatment effects to a new file called filename. When the outcome variable is categorical, doseresponse creates a new file for each category i of the outcome variable and names it filename_i.

detail displays detailed output for the gpscore command and the results of the regression of the outcome on the treatment and the GPS.

Remarks

Please remember to use the update query command before running this program to make sure you have an up-to-date version of Stata installed. Otherwise, this program may not run properly.

The treatment has to be continuous. The outcome can be of any nature: binary, categorical, or continuous.

Make sure that the variables in varlist do not contain missing values.

Examples

. #delimit ; . doseresponse agew ownhs male tixbot workthen yearw, . outcome(year6) t(prize) gpscore(mygps) predict(hat_treat) sigma(hat_sd) . cutpoints(cut) index(p50) nq_gps(5) dose_response(mydoseresponse) . ;

. #delimit ; . doseresponse agew ownhs male tixbot workthen yearw, . outcome(year6) t(prize) gpscore(mygps) predict(hat_treat) sigma(hat_sd) . cutpoints(cut) index(p50) nq_gps(5) dose_response(mydoseresponse) . t_transf(ln) normal_test(0.01) reg_type_t(quadratic) . reg_type_gps(quadratic) bootstrap(yes) . ;

. #delimit ; . doseresponse agew ownhs male tixbot workthen yearw, . outcome(year6) t(prize) gpscore(mygps) predict(hat_treat) sigma(hat_sd) . cutpoints(cut) index(p50) nq_gps(5) dose_response(mydoseresponse) . t_transf(ln) normal_test(0.01) test(Bayes_factor) . reg_type_t(quadratic) reg_type_gps(quadratic) bootstrap(yes) analysis(no) . ;

Authors

Michela Bia Laboratorio Riccardo Revelli Centre for Employment Studies, Collegio Carlo Alberto michela.bia@laboratoriorevelli.it

Alessandra Mattei Department of Statistics, "Giuseppe Parenti", University of Florence mattei@ds.unifi.it

Also see

Article: Stata Journal, volume 8, number 3: st0150

Online: gpscore