Citing code borrowed from other source files
Hi, I'm writing a few programs that adapt ideas and code chunks I've found in a couple of stata source files. Does anyone the appropriate way to cite this code? I'm planning on posting the programs...
View ArticleForecast's Confidence Levels - VEC model
Dear all, Do you know how can I plot a forecast form a vec model with several confidence levels in the same graph? Stata allows me to choose one confidence level. Then I estimated a VEC model twice,...
View Article- chaidforest - updated on SSC
With many thanks to Kit Baum, a new version of the module chaidforest is available on SSC. Description chaidforest is an implementation of a random forest (Breiman, 2001) ensemble classification...
View ArticleEsttab and reg3
Hi everyone, I've looked online a little bit, but cannot find anything too definitive on the following matter. My goal is to esttab results from reg3 to be in a nicely presented table, just like I...
View Articlestring to missing
hi everyone! I have a small dataset of perceptions, likert scale. the thing is some answer are "na" meaning for do not apply. I want to encode this variables as missing but I get a type mismatch. Here...
View ArticleHow to adjust the cox model schoenfeld residual plot is flat but with non...
When I tested the PH assumption of cox model. schoenfeld residual plot is flat (with zero slope) but with non zero mean (y=-0.3). The chi2 statistic for this variable is significant. And even after I...
View Articletobit with known but varying censoring points
This ought to be a common problem. My data has a constant censoring point in nominal dollars, but I want to estimate panel and stacked tobits for multiple years in real dollars, meaning I have a...
View ArticleExport a table (or regressions) to excel format
Hello, I would like to know what commands I use to export a table (or regressions) made in STATAusing the PCA (Principal Components/Correlation and Principal Components/Eigenvectors) to excel format (...
View ArticleTransforming z-scores into NCEs
Hello, I have a dataset where my dependent variable is student_score (from a math standardized test) and a series of independent variables, e.g. class size, household characteristics, age, gender, etc....
View Articlelong names of labels
I'm doing a simple two-way tabulation. The first variable is value-labelled, with some rather long values; some are as much as 46 characters. (I believe that the fact that they are label values is...
View ArticleAppend to global macro in foreach
I want to append to a global macro using foreach. I also want to call a macro ('stem') as part of the macro name. This performs the desired task; : global stem abcdefg macro drop d$stem foreach x of...
View ArticleReplacing blanks conditional on value sin another variable &...
Hello, I have a variable po that only contains one value. However, I want to populate this variable so that if po is true for a particular id, then true will be inserted for all instances of that id,...
View ArticleDisplaying variable value using putexcel command
Hello all, I have what I believe to be a simple problem but I have wasted so much time on it. I am writing the results for the summary command for a single variable in a foreach loop, using putexcel,...
View ArticleHow do I do stcox or stmc with a categorical variable?
Hello Statalist and welcome to me. I look forward to assisting other users with aspects of Stata that I am familiar with. I'm trying to do survival analysis in Stata with both categorical variables and...
View Articlematrix with loops
Hi everyone, few hours ago I was having problems posting here something with rich text, so I hope everything goes fine now. I have a very small dataset of a survey of perceptions. I have six variables...
View ArticlePanel Attrition - too many Rejoiners
Hello, I´m working with the SOEP(Lecture-Dataset). I would like to analyse the panel attrition from 2000 - 2008 using the code provied in Applied Health Economics Chapter 10. miss = 1 if in sample and...
View ArticleGauss Error Function in Stata
Dear All, I am writing to seek help on the Error function in Stata. I would like to write a survival function from the cumulative distribution function of lognormal distribution but cannot figure out...
View ArticleInterpretation of BIPLOT
Good morning listers, I have a dataset of 1500 respondents with their status on 7 ordinal variables that are supposed to represent cardiac health. Although Males and Females have similar total...
View ArticleSpecifying iterations for biprobit 1st, 2nd models
Good morning, I am running a biprobit model in Stata 14, and want to stop the first two "fitting" equations after a max number of iterations. (In order to skip over non-converging models... I am...
View ArticleDoubts about using xi: command
Hello Stata users: I'm new in Stata, and would like to ask a question related to the use of the command xi: I've been reading about this command, which can be really useful when we do a regression that...
View Article