how to define a date and time as a timeseries?
Hi Guys, I've done quite some research on this online and found nothing thats able to help me. I am working on a project through in which I will be looking at the data of changes in stocks on 15 minute...
View ArticleError when using reclink and loop to match records
Dear all, I'm working on matching birth records to hospital discharge records using reclink. The files are huge, so I've broken them down into monthly files - each month of births contains 9-10...
View Articlepuzzling out for num line of code
hi guys! I recently received a *do file dating back to 2010 and there's a line of code I'm struggling with: for num 1/6: by xwaveid: replace hhfxid=hhfxid[X] if hhfxid=="" where xwaveid is the...
View ArticleMerging more than two datasets in Stata
Hello: I am a beginner in Stata, and currently working with NHANES data in Stata, my question is can you combine more than two data sets on stata? I tried to use the merge command and the "combine...
View ArticleUsing stsplit for time-varying covariates in stcox
I am doing a large registry-based study, in which I am doing Cox-regression for mortality rates in hyperthyroid individuals compared to euthyroid individuals. Furthermore, I am splitting the...
View ArticleMultinomila logit with different sets of alternative specific variables
Hi. I have a question regarding multinomial logit models in STATA. I'm trying to estimate a trip mode choice model in stata. The alternatives have different specific variables. For Instant the transit...
View ArticleReplace Sample vs Population
Hello, i need help. I have 4 variables i.e. VRegS VRegP VregPmake and VRegSmake. Capital S stands for sample while P stands for population VRegS=vehicle registration for sample VRegP= vehicle...
View ArticleSubsetting data
Hello, I'd appreciate if you could help me with Stata syntax for the following analysis. I've got the HCV treatment dataset. I need to run analysis on the subset of patients who have received an...
View ArticlePrint variable mean in graph export?
Dear All, consider the following minimal example: Code: clear webuse grunfeld, clear g ret=invest/1500 bys company (year): g cumul=ret if _n==1 replace cumul=ret + l.cumul if missing(cumul) keep if...
View ArticleNested for loops
I would like some help with writing a nested for loop. So far this is what I have foreach x of varlist A- J{ gen Share_`x' = 0 foreach y of varlist 1- 10{ replace Share_`x' = ( `y'/ `x') } } What I...
View ArticleMerge Sample Var with Population Var
Hello, i need help. I have 4 variables i.e. VRegS VRegP VregPmake and VRegSmake. Capital S stands for sample while P stands for population VRegS=vehicle registration for sample VRegP= vehicle...
View Articleunderstanding matsize
So im getting a matsize to small error.. first problem is I have matsize maxed out, at 800.. second problem, how do i calculate my number of variables in my matrix? Model contains a total of 4,964...
View ArticleGenerating lagged variables in mi data
I'm having trouble generating lagged variables in mi data. Here is an example where students are tested in reading and math at 3 different times, and I try to generate a variable that lags the scores...
View ArticleUsing prediction results from interval regression to compute Oaxaca...
I have an ordinal wage variable and I wish to use interval regression to obtain a predicted wage in interval form. I am using STATA `intreg' function to predict the wage from a set of explanatory...
View ArticleDegrees-of-freedom adjustment for FEs in complex survey data
Hello, I would highly appreciate if you could help me with the following problem: Since the svy command does not support areg, I want to manually demean my variables (I have more than 35'000 groups, so...
View ArticleUsing data not found (nearmrg)
Hello, I am trying to use nearmrg on my data files and I keep getting the same error: "Using data not found". As I wanted to break down the problem I used very simple test data instead of my real data...
View ArticleUsing data not sorted (nearmrg)
Hello, I am trying to use nearmrg on my data files and I keep getting the same error: "Using data not sorted". As I wanted to break down the problem I used very simple test data instead of my real data...
View Articlecdsimeq regression storing and exporting
Hello, I am using cdsimeq command to estimate a simulatenous equation with probit endogenous variable ans i am not able to store and export output result with estout, esttab or outreg2. I would request...
View Articleprobit model: partial effects of a one-SD increase on dep. variable
Dear Statalist community, I'm using a probit model to analyze the determinants of free trade agreements (FTA). The dependent variable FTA is binary: 1, if an FTA between a country pair exists, 0...
View ArticleDecomposing differences using nldecompose for nonlinear model
I am using nldecompose for decomposing differences in the outcome variable for nonlinear model. Has anyone worked with this command, may I know how you compute the contribution of each variables...
View Article