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

Title

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

Syntax

doseresponsevarlist[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_modeltreat_var GPS_var[if] [in] [weight],outcome(varname)[cmd(regression_cmd)reg_type_t(type)reg_type_gps(type)interaction(#)]

fweights,iweights, andpweights are allowed; see weight.

Description

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

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

Options

Required

outcome(varname)(doseresponseanddoseresponse_model) specifies thatvarnameis the outcome variable.

t(varname)specifies thatvarnameis 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 atvarnamequantiles.

index(string)specifies the representative point of the treatment variable at which the GPS has to be evaluated within each treatment interval.stringidentifies 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 pointindex(string)of each treatment interval have to be divided into#(1 <=#<= 100) intervals, defined by the quantiles of the GPS evaluated at the representative pointindex(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 defaulttransformationis 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 thatgpscorewill perform to assess the validity of the assumed normal distribution model for the treatment conditional on the covariates. By default,gpscoreperforms 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 isnorm_level(0.05).

test_varlist(varlist)specifies that the extent of covariate balancing has to be inspected for each variable invarlist. The defaultvarlistconsists 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 thatgpscoreestimates 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)(doseresponseanddoseresponse_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 iscmd(logit)when there are two distinct values,cmd(mlogit)when there are 3-5 values, andcmd(regress)otherwise. The supported regression commands arelogit,probit,mlogit,mprobit,ologit,oprobit, andregress.

reg_type_t(type)(doseresponseanddoseresponse_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 defaulttypeislinear. Alternatively,typecan bequadraticorcubic.

reg_type_gps(type)(doseresponseanddoseresponse_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 defaulttypeislinear. Alternatively,typecan bequadraticorcubic.

interaction(#)(doseresponseanddoseresponse_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 thatdoseresponseestimates the average potential outcome for each level of the treatment invector. By default,doseresponsecreates a vector with theith element equal to theith observed treatment value. This option cannot be used with thenpoints(#)option.

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

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

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

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

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

analysis(string)specifies thatdoseresponseplots 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,doseresponseplots only the estimated dose-response and treatment function(s). If the user typesanalysis(no), no plot is shown.

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

graph(filename)stores the plots of the estimated dose-response function and the estimated treatment effects to a new file calledfilename. When the outcome variable is categorical,doseresponsecreates a new file for each categoryiof the outcome variable and names itfilename_i.

detaildisplays detailed output for thegpscorecommand and the results of the regression of the outcome on the treatment and the GPS.

RemarksPlease remember to use the

update querycommand 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

varlistdo 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) . ;

AuthorsMichela 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 seeArticle:

Stata Journal, volume 8, number 3: st0150Online:

gpscore