Split Time Series Variables
How can I Split Time Series Variables? I want to split variables to each group of the same variable name, like that: . local var1 "l(0/2).x1 x2" . display "`var1'" l(0/2).x1 x2 . tsunab var2 : `var1' ....
View ArticleWrapping lines in the do file
Hi friends, I am trying to wrap long lines of code in my .do file text to make it less cumbersome to interact with. I have tried several methods including adding "///" at the end of each line to...
View ArticleShading area under a line
Dear all I am trying to shade the area under a line on a scatter plot but despite my best efforts i cannot seem able to make it work. I am using the following code to define the coordinates of the...
View ArticleComputing Effect Sizes for Marginal Effects
Hello all, I'm looking at test accuracy (outcome variable) between different conditions. I ran a mixed effects logistic regression with interaction, and wanted to look at the differences in the...
View ArticleGraph in rd package
Dear experts This might be a rather basic one, but I just cannot figure it out. Search didn't reveal a similar problem. I have a dataset consisting of the number of accidents for a period of 10 years...
View Articlecreating time-constant variable across individuals
Dear all, I am working on creating a simulation code for panel data. I need to create a variable that is constant over time from a given distribution function (which is not a problem), then this...
View ArticleAre these variables appropriate?
I am running a fixed effects regression on wages and gambling to see what impact gambling has on earnings. The dataset I have been given has two interesting variables - poverty and unemployment rate....
View ArticleRunning a regression with total annual hours worked and total annual wages
I am currently running two fixed effects regressions. One is to illustrate the impact of gambling on total annual hours worked. The other is to illustrate the impact of gambling on total annual wages....
View ArticleVariables become insignificant when moving from OLS regression to fixed...
Hi, I know that fixed effects estimation (demeaning across time) removes time-invariant observables and so variables like race and gender drop out. I also have read that when you run fixed effects...
View Articlesktest displaying strange results
Hi, I am running the sktest after using "predict varname, e" after running a fixed effects regression. I find that when I use sktest, the results are: Pr(Skewness)=0.0000 or 1.0000 Pr(Kurtosis)=0.0000...
View ArticleInstruments are not underidentified for males but they are for females
Hi, I am running a fixed effects regression on wages worked on drug use and I have split my sample by male and female. After running xtivreg2, I can see that my instruments are not underidentified for...
View ArticleSample Selection Bias in Panel Data
I am searching for a method on how to do the selection into employment with panel data, so that in the second step I can estimate the wages and total hours worked of the employees. I found that some...
View ArticleHow to predict the prob of each specific outcome/stage after using Marteen...
Hi, I am using Marteen Buis' seqlogit and even after playing with the various alternatives explained in http://repec.org/bocode/s/seqlogit_postestimation.html I do not find the way to estimate...
View ArticleLoop, residual collection, skip variable with all missing observations
Dear Stata users My data is in panel format. I am running the following code: Code: gen resid = . levelsof j, local(j) foreach i of local j { regress r_mid Rm if j == `"`i'"' predict temp, resid...
View ArticleIMF Error
Hi, everybody, I attempt to use impulse response function on two sets of data seperately, first set(n=80) is fine, second set(n=39) keeps showing error, the result is as follow: . irf create order1,...
View ArticleExport output into multiple Excel worksheet at a time
Hi all, I want to export the observations by year and state into different worksheets. I was to able to export the data by "State" for all year, but the same code did not work to export by year. Is it...
View ArticleModel fit statistic for population-average specification
Hello everybody! For the purpose of my study I am using an exponential Poisson model with population-averaged (PA) effects, as implemented in -xtpoisson, pa-. However, neither of the fit statics (e.g.,...
View ArticleWhy do I put parentheses ( ) around a variable that the results are different?
Dear All, I calculated the willingness to pay by stata 11.0 from 2 equations. 1. Code: nlcom ((_b[ba_salary]*15000)+_b[inf7]+_b[log7]+_b[ asc])/(-_b[ ba_salary]) _nl_1:...
View ArticleInteraction lsens
Dear all, I want to minimize total errors in my prediction following from a logit model. Hence, I reckoned that the intersection of the sensitivity and specificity curves may be a good starting point....
View ArticlePerforming Truncated Regression with Endogenous Variable
Hello, I am trying to estimate the following simultaneous equation model: Code: Y = B0 +B1*X + u X is endogenous, but I have a credible instrument, Z. So if all my variables were continuous, I could...
View Article