I have constructed a multivariable linear regression model with approx twelve explanatory variables. How can I plot the effect of one explanatory variable against the outcome measure, after adjusting for the other variables? For example, outcome is blood pressure, exaplanatory variables are: age, sex, ethnicity (Caucasian, Black, Asian), pulse rate etc. How can I plot ethnicity against blood pressure adjusting for others?

Many thanks in advance.

]]>

So I have got monthly panel data of about 5000 firms over a period of about 10 years and need to construct equally weighted as well as value weighted top in class and bottom in class portfolios based on a sustainability measure. Afterwards I need to take the (equally weigthed or value weigthed) returns of those portfolios and regress the Fama &French factors against them. Since I am not very experience with stata I was wondering whether someone could help me with the commands to do so. Therefore I would need a command that select the returns of the top and bottom 25 % each month based on the sustainability variable followed by a mean command of those returns and then regressing them with three other varables. For the value weighted portfolios I would also need a command which would weighted each return by the fraction of this firms market value to the whole market value within that portfolio.

Any help is highly appreciated

Regards,

Lutz]]>

I have panel data and want to make a twoway graph with year on horizontal axis and median of the variable(s) on vertical axis for different interquartile range of some orther variables.

More specificaly, I want 3 lines. One shows median(investments) when leverage (for example) is lower then 10th percentile. Second line is median(investment) when leverage>leveragep(90) and third is median(investments) when leveragep(40)<leverage<leveragep(60). And I need this for every year. So, the graph has to show how the median of investments behave for different leverage group of firms, through time (as I said, I have panel data).

Please help

]]>

So I have got monthly panel data of about 5000 firms over a period of about 10 years and need to construct equally weighted as well as value weighted top in class and bottom in class portfolios based on a sustainability measure. Afterwards I need to take the (equally weigthed or value weigthed) returns of those portfolios and regress the Fama &French factors against them. Since I am not very experience with stata I was wondering whether someone could help me with the commands to do so. Therefore I would need a command that select the returns of the top and bottom 25 % each month based on the sustainability variable followed by a mean command of those returns and then regressing them with three other varables. For the value weighted portfolios I would also need a command which would weighted each return by the fraction of this firms market value to the whole market value within that portfolio.

Any help is highly appreciated

Regards,

Lutz]]>

Dimet]]>

1 1 1 4

2 1 2 5

3 1 3 6

1 2 4 4

2 2 5 5

3 2 6 6

1 3 7 4

2 3 8 5

3 3 9 6

]]>

I wish you a a nice weekend.

I have two groups of companies: treatment and control.

I want to match the companies from each group using a basic matching approach, based on size and its industry.

I tried to search for that and I came near the "psmatch2" command. The problem I am facing is that I am not being able to tell Stata that this group is the treatment and that group is the control.

I would really appreciate any suggestions regarding the implementation of the command:

:

psmatch2 depvar [indepvars] [if exp] [in range] [, outcome(varlist) pscore(varname) neighbor(integer) radius caliper(real) mahalanobis(varlist) ai(integer) population altvariance kernel llr kerneltype(type) bwidth(real) spline nknots(integer) common trim(real) noreplacement descending odds index logit ties quietly w(matrix) ate]

Best wishes]]>

I hope you are all doing well.

I am using a difference-in-differences (DiD) research design where I have 2 groups (treatment and control) who went under some mandatory policy at the same time.

As far as I know, the DiD methodology is simply having the following indicator variables:

1) Time indicator variables: pre is zero and post is one.

2) Group indicator variable: control group is zero and treatment group is one.

3) DiD estimator: the interaction between the time and the groups indicator variables.

As for the regression equation: Y = X1 + X2 + X3 + time_indicator + group_indicator + DiD_indicator +e

where X1, X2, & X3 are control variables.

I hope that my post is clear.

Thank you very much for your valuable suggestions.

Mustafa]]>

I'm replicating a paper for my master's program. The author uses a GLS estimation method adjusting for first-order autocorrelation. In the paper, there is a coefficient and and a standard error. My question is how to obtain that coefficient.

Im using the xtreg command. Should I be using a different estimation?

Thanks,

Yolanda

]]>

I have following set-up in my experiment.

- 1 control group

- three treatment groups

- Individuals in all treatments are asked to choose cost-efficient contracts. Therefore, the relevant/dependent variable is binary 1=success; 0=failure.

1)

Now I want to compare if "on average" the treatments exhibit different proportions with regards to successes/ correct choices, i.e. (number of successes/total number of choices in treatment)=proportion of successes.

I also have some hypotheses, e.g. that the proportion in treatment 1 should be higher than in the control group etc. so 1-tailed tests should be run as well.

--> I have looked in the forum and in the web, but I don't find a satisfactory answer on how to run a test that tells me whether the proportions of successes between the samples are statistically different. Moreover, before my experiment I ran the power/sampsi command in order to determine what sample size I need. However, my result proportions are closer together than I assumed and hence, if I run the power test now, my sample (for each treatment) is not large enough. So when I run sampsi p1 p2, n1 n2 onesided I get a maximum power of 0.56. What test can I use in stata to conduct one-sided tests to see if the proportions are different on a statistical level (and maybe control for my control variables)

2)

Moreover, I have several control variables, and I wanted to run a logit/probit in order to see, which of the factors have descriptive power with the binary variable being the dependent.

- If I include the treatments as variables as well, i.e. dummy variable1 = 1 if control group, dummy variable2 = 1 if treatment 1; dummy variable3 =1 if treatment 2, etc. would this also be a test to see whether my treatment effects are significant?

- Another approach I saw was using "margins", dydx; how I understand it, this should yield the same results as the normal logit/probit but ignore the constant terms.

Thank you very much in advance for your help and best regards,

Benjamin

]]>

:

twoway (kdensity txmort if d_cor==1) (kdensity txmort if d_cor==0) if ano_obit==2005, ytitle("Densidade de Kernel") /// xtitle(tx mortalidade) legend(order(1 "corrup" 2 "nao corrup"))

:

twoway (kdensity txmort if d_cor==1) (kdensity txmort if d_cor==0) if ano_obit==2005, ytitle("Densidade de Kernel") /// xtitle(tx mortalidade) legend(order(1 "corrup" 2 "nao corrup")) yscale(range(0 1))

I have recently been working on some multi-level models using the xtmixed command. For one of the models the chi2-test statistic of the Hausman endogeneity test was negative. Is there an alternative test in Stata 13 to test for the endogeneity of regressors? Or is the negative test statistic already an indicator of endogeneity? Any hints on this would be appreciated.

Best,

Michael ]]>

I am using cdeco to decompose the effects of characteristics and coefficients in a quantile regression setting. This is a Oaxaca-Blinder decomposition type approach. cdeco is a user-written command provided by Chernozhukov, Fernández-Val and Melly (2013) which extends the work of Melly (2005). The code is available from Melly's personal website: http://www.econ.brown.edu/fac/Blaise...e_counter.html.

My data comes from a complex survey design. Therefore I use the svy command in stata as follows:

svyset [pweight=w_fstuwt], brrweight(w_fstr1-w_fstr80) vce(brr) fay(0.5) mse

When I run the command:

svy brr: cdeco pv $correl, by(year2) weight(1)

I receive this error:

cdeco is not supported by svy with vce(brr); see help svy estimation for a list of Stata

estimation commands that are supported by svy

r(322);

Does this mean that there is no way to account for the survey design with this command -cdeco-?

Moreover, is there a way to run the -qreg- command accounting for my survey design?

Thanks?

]]>

I am running a simple oaxaca regression with many independent variable. These independent variables have missing values in some observations. However, the output of the oaxaca regression shows that the number of observations used is the whole sample. This is really strange... Any idea why is it the case?

Thanks!]]>

I am experiencing some difficulties in using the if command in STATA.

I want to use the p-value result from a lrtest in an if condition.

I am using the following code:

:

... stgenreg, loghazard([xb]) bhazard(rate) xb(rcs_age1 rcs_age2 | #rcs(df(5)) | /// rcs_age1:*#rcs(df(2)) rcs_age2:*#rcs(df(2))) nodes(30) eform estimates store M1 stgenreg, loghazard([xb]) bhazard(rate) xb(rcs_age1 rcs_age2 | #rcs(df(5))) nodes(30) eform estimates store M2 lrtest M1 M2 local p1=r(p) if `p1'<0.05 { local m=1 }

<0.05 invalid name

I am not understanding why this is not working.

Thank you in advance for your help.

Best regards,

Luis

]]>