How to make a variable from multiple categorical variables
Good afternoon, The data that I am using has a unique individual identifier for each respondent, "folio." Unfortunately a mistake was made while inputting the data and in one file containing 162 food...
View ArticleGenerate variables based off labels
I am looking for a way to reshape some data (long to wide) by way of creating the new wide variables based off of the labels contained in two of my category vars. The data currently looks like this:...
View ArticleFixed effects or Randomeeffects? small N
Greetings All! I'm doing an analysis of deforestation and its drivers (so dependent variable is deforestation, and independents its drivers). Ive run some regressions, and the Log - Log model seems to...
View ArticleHow to Plot Conditional Volatility
Hello, I use the attached data to estimate the following model: mgarch dcc (RFTSEKuwait = RSP500, noconstant), arch(1) garch(1) nolog iterate(100) How do I plot dynamic variance forecasts and...
View ArticleConstraint of error terms (by setting them equal) not showing up in output
I am constraining two error terms in an SEM model by setting them equal to each other. The model runs fine. However the output shows that the error terms are actually NOT equal to each other. Does...
View ArticleAgreement between two methods
All: I am new member to The STATA Forum. I want to assess the agreement between methods (A-standard and B-new) used in assessing performance of bednets. I am using Bland and Altman analysis method. I...
View Articledata management - Creating new variables using bysort and generate
Hi All Currently working with a longitudinal dataset, where a subject may have several clinic visits in a given clander year. Additionally, the subject maybe have several clinic visits over several...
View ArticleHow to apply longitudinal weights?
Dear all, I am dealing with data from EU-SILC, a European survey designed as a rotational panel. I need to use longitudinal weights to account for attrition and replacement each year. Eurostat already...
View ArticleString: Extract first part of a string
Hello guys, This may be a very easy questions but I couldn't figure it out. I have a string variable that looks something like this: MMDC-6MA. CC - GG55 GMO - GU564 I need to extract the first letters...
View ArticleError with append, keep() in Stata 14.1
So this is going to sound kind of strange, but I am working with a dataset that has too many variables for Stata to handle, so I'm only loading a subset of the data: Code: use dupersid panel STJBYY*...
View ArticleFrequency table
I'm sure this question has come up before, but I can't find a solution after looking around, so I'll pose it here. Say I have a binary variable, a. I want to tabulate the one's in a by two other...
View ArticleHow to apply longitudinal weights? Edited
Dear all, I am using data from a rotational panel following households. Thus, households are followed for a number of years, but part of them is replaced by new families each year. I deal with this...
View ArticleReasons for constraining error terms?
It was suggested that for my SEM models and CFA models I set my error terms equal to each other. Not quite sure what the reason(s) behind this would be. Any ideas? Also, my latent variables each have...
View ArticleOutreg2
After having obtained results on a binary logit regression, I would now like to include the results in my paper. I read that outreg2 is used to convert regression outputs into the standard format....
View ArticleEndogeneity in choice models following Petrin and Train (2010)
Dear all, Following Petrin and Train (2010) discussing Endogeneity in choice models, I am trying to obtain a residual of a regression model (OLS) and include it in an ASC (alternative specific...
View ArticleCompute average for selected years on the panel data
Dear all, I have a large panel dataset organized by firm, year, and other firm specific measures (e.g. size, debt ratio, etc.) Below I listed a few observations for demonstration. ID: firm identifier...
View ArticleGenerating dummy variables!
Hi all! I am working on a student school admission data set which has admission status of the child, the order of preference of the schools (applied to), and a bunch of SES variables for each child. I...
View Articleextracting the day of the week from a SIF in a dmy standard
Hi everyone I would like to extract the day of the week from a DMY form in stata. So below is the code is used to convert my time variable into a stata readable form. gen double date2 = clock(...
View ArticleProblem with varsoc command and its maxlag option
Dear all, I collected GDP growth(QtoQ) from 1960 to 2015, and I want to fit an AR model to it. I am using the command varsoc to select the optimal lag length, and I find that the result is sensitive to...
View Articlextmixed with complex survey design
Hi all, I have a question regarding multilevel modeling with complex survey design. I set my survey design as: Code: svyset district [pw=weight], strata(region) || block Then, I run my linear...
View Article