:

http://www.stata.com/statalist/archive/2012-11/msg00757.htmlthat says that it is possible to treat simulated data as if multiply imputed.

The --heckprob-- command is not supported by --mi estimate--, and I'm forcing it with the --cmdok-- option (it should be OK, according to this post:

:

http://stats.stackexchange.com/questions/65678/using-heckman-in-combination-with-mi-estimate-stata

My data are at the individual level, and it is a repeated cross-section dataset. What I'm running is essentially:

:

mi estimate, cmdok post: heckprob y c.x1##c.x2 [pweight=weight], select(z = x3 x4 c.x1> 0##c.x2) vce(cluster psu)

The estimation converges, and I get coefficients and standard errors. However, the second parameter of the F-statistics is missing, and of course also the value of the F statistic and its p-value:

:

F( 4, .) = . Prob > F = .

If I run --heckprob-- on one of the simulations only, i.e. I get rid of --mi estimate-- and only use --heckprob-- I get values for the Wald chi2.

What could be the cause for my problem? Could it be that heckprob is actually not suitable for MI? And, even if my F statistic is missing, can I trust the coefficients and the standard errors that I get from the estimations?

Thanks,

Rossella]]>

xtabond rdintensity

estat sargan

Interestingly, even in this simple form I receive a zero p-value for the sargan test. I know that R&D intensity is highly path dependent and therefore the lag instruments may not be very strong exogenous instruments but is DPD is not designed to specifically deal with this problem(lagged dependent)? What should I do to resolve the issue? is it sound to just ignore this?]]>

The question I have is whether I should run PCA on the firm panel... i.e. there is one response for each frim on each question. I would run PCA on just the firm panel and then attach the predicted component onto the worker level panel.... OR whether I should first do a m:1 merge between the firm and worker panel... and then use PCA to predict the component.

I know these procedures yield different results and I am not sure one way is right/wrong but I thought to ask for others insight. Thanks.]]>

I would like to estimate the following equation:

:

Y = A + B*X1 + C*X2 + E

- X1 may be reversely caused by Y. On its own, I would solve this problem by instrumenting X1 with instrument Z1, which is exogenous to Y:
:
--ivreg2 Y X2 (X1 = Z1)--

- Whether Y is observed, may also depend on X1, i.e. I have a possible selection problem. On its own, I would solve this problem by first estimating a Heckman Probit model, regressing I(Y!=.) on X1, X2, and Z0, where Z0 should not influence the value of Y:
:
--heckman Y X1 X2, select(Z0 X1 X2)--

Put differently, I have two outcomes Y1 and Y2, where Y1 may amongst others depend on Y2, so an alternative to the above

:

- Y1 = A1 + B1*Xb + C1*Xc + D1*Y2 + EPS1
- Y2 = A2 + B2*Xb + C2*Xc + D2*Z2 + EPS2

Best regards,

Ruediger

]]>

I am trying to run the tests to satisfy assumptions for MANOVA. I have one sample with multiple IVs and DVs. My question is, do I need to run mvtest covariance Y1, Y2... by (group) (each IV) or is there some other or better way to do this?]]>

r(498);".

Any idea about increasing/setting the number of possible iterations?

Thank you!

]]>

thank you.]]>

I'm wondering how to test my regression for heteroscedasticity, I have tried hettest, rvfplot, imtest etc but those only seem to work for "normal" regressions using "reg" command.

Thank you in advance!

Teodor]]>

forvalues icv_ = 0/2 {

tab2mat2 cuidado if elegibles==1 `cond`icv_'' [aw=v005], matcell(StatTotal)

mat Chequeo1_`title`icv_'' = r(StatTotal)

}

mat Chequeo1 = [Chequeo1_Total, Chequeo1_ICV1, Chequeo1_ICV2]

It doesn't find the variables of the last matrix.

PD: tab2mat2 it's a command created personally.

]]>

I have a query I'm hoping someone can advise me on. I've looked at journal papers, textbooks, other forums, and have tried people at my own institution (those who are familiar with area don't have time to help!), and while I can see what I want to do can be done, I don't have any clear advice on how to proceed...

Here's a broad outline of my problem:

I'm fitting a multilevel model using an historical data set. I then want to use this model to make future predictions of the outcome variable. As well as predicting the outcome for clusters included when fitting model, I want to predict the outcome for new clusters (i.e. clusters not included when fitting the model).

To do this I first need to predict the values of the random effects for each cluster. In Stata, this is simple enough for clusters included when fitting the model (i.e. Stata can give me random effects as point estimates and errors). But, I don't know how to do it for new clusters. I see this is possible from an explanation given by Andrew Gelman ('Data Analysis Using Regression and Multilevel/Hierarchical Models') but he uses R and WinBUGs: at the moment I don't have time to learn how to use these so need to stick with Stata. A key paper using Stata is by Skrondal and Rabe-Hesketh ('Prediction in multilevel generalized linear models') but they don't cover how make make predictions of random effects for new clusters (at least as far as I understand the paper).

In sum, my question is:

After fitting (estimating) a multilevel model in Stata, how (e.g. commands; particular restructuring of the data) do I predict random effects for new clusters?

(Note that, the reason I have new clusters is that I have historical data for the outcome variable for a sub-set of the clusters, but projection data for the predictors for all clusters).

Any help would be greatly appreciated.

Thanks

S]]>

I am using Stata/SE 13.0 on Windows.

I am struggling with vertically combining string variables into a single string (combining several ‘observations’ into a single one). I have text data that I had to import into stata in a way that puts each line of text as a separate observation. This is both useful for isolating certain lines of text that I need to isolate (so I do not want to merge all text into a single observation before importing into stata), but also bad because I do have to now combine some of the lines back together.

I am trying to combine them using the following command (and a loop around it, as I will describe shortly):

gen var2 = var1[_n]+var1[_n+1]

This works fine, but the problem is that the number of lines of text that need to be combined vary unpredictably. I want to combine all lines of text until an empty line is encountered, after which I want to start over, as there are many such lines. In other words, my data looks like var1 and I want to create a new variable, var2, that will look as follows, without knowing how many lines will need to be added in each case (here I first need to combine 3 lines and then 4 lines):

Some text describing Some text describing something but only until some point

something but only until

some point

Then again some text Then again some text Describing something But this time it runs until Line four

Describing something

But this time it runs until

Line four

Is there a way to do this with a loop? E.g. ‘carry out gen var2 = var1[_n]+var1[_n+1]+…+var1[_n+X] if observations 1-X are non-empty and observation X+1 is empty’.

I think I need a loop with a stopping rule, but I do not know how to write one that will do exactly this.

Thank you so much for all your help in advance!!

All the best,

Victoria

]]>

I need to estimate a dynamic (autoregressive) model for a censored dependent variable. I have previously worked with xtabond2 but I can't use it right now due to the characteristics of the dependent variable. Please look at the enclosed histogram.

I found that xtgee allows for controlling autoregressive correlation but it does not estimate models for censored variables (I believe I can use xtgee for an autoregressive model with dichotomous dependen variable, right?). On the other hand, xttobit does not allow controlling for autocorrelation in the first level.

Do you know something, such as xtgee, that I could use for estimating the model?

I have a panel data of 20 years with more than 3000 firms and I use Stata 13.1

Thank you in advance for your help!

Claudio

]]>

Sorry if my question is stupid, I'm an undergrad student so I'm relatively new with Stata.

Thanks in advance]]>