Simulation based on regression coefficients
Dear Stata users, I am estimating the OLS model below and then use it to compute the linear prediction using values of covariates (i.e. xa2, xa3, etc.) from an external dataset (as shown in table...
View Articleassociating pairs of lists
How could I associate, in a foreach, each `i' to another specific term? I would like to put in some variables the exactely same label except for one word, which depends on part of the variable name....
View ArticleAppend data
Dear Statalisters, The process of my coding is:I have 90 small datasets to be merged into a master data Let us say we start with first merge Compute some values after merging Save the data , repeat...
View Articlecannot be converted reversibly; no replace
Hi, I am using Stata 13 on Windows 7. I am running the code tostring phone_number, replace and the message I get is phone_number cannot be converted reversibly; no replace This usually happens with 12...
View Articlesem/gsem extremely slow
Hello I wonder... is there any way to increase the speed in Stata's SEM or gSEM analyses? Every time I try -sem- og -gsem- I give up due to speed issues. Admittedly, I don't do many simple SEM...
View ArticleHow to only keep firms with at least three consecutive annual observations?
Hi! I have a panel data with information about different companies and observation over time. CompanyID Year 1 2000 1 2001 1 2002 1 2003 2 2005 2 2006 2 2008 2 2009 2 2010 2 2011 I want to only keep...
View Articlelarge database
Hi, I am using STATA 12 and my computer has the following memory settings: Installed memory (RAM): 96GB (32 GB usable) I use the command set memory and my "stata" memory --> set max_memory 96g. I am...
View Articlemixed incomplete random effect tables
Goodmorning, I have problems in using mixed with Stata 13. I don't get the complete results table for the random effect component. I report the command and the results: As you can see, for the random...
View ArticleCan I improve estimation speed of gsem command using Stata/MP?
Hi, I have question regarding optimizing the multiple processor features in Stata/MP (13.1). I have access to a high speed shared computing facility at work and can connect to a node which has 64 GB...
View ArticleCompatibility of gllamm in Stata 14?
Hi there, Has anyone tried to use the user-written gllamm command in Stata 14? Whenever I try to run a model, I receive an error code. Please find the syntax and output below: . use...
View Articlegllamm selection model, definition of variables in selection and outcome...
Hey, I´m trying to use the gllamm command for a multilevel selection model. But I do not know how to define the variables which should be used in the selection Regression or outcome Regression. Right...
View ArticleMaking your machine "beep" when a do-file fails
Hi, all - This a very simple question. When I write a do-file, I often make my computer sound with a "beep," using Keith Kranker's nice package for Windows machines. I've found this great for long...
View ArticleUndocumented limit on matrix size
Dear Colleagues, The following problem came to light in discussions with the authors of medeff (mediation analysis command). According to this FAQ: http://www.stata.com/support/faqs/ma...-than-matsize/...
View ArticleLooping through a macro to determine if contains variable
Hi, I'm having an issue with the extended macro function "in." In essence, I have to global macros that I combine, which may contain duplicates elements. I'm using the "in" function to determine...
View ArticleCapture confirm
Hello. How could I use -capture confirm- to confirm if a file is empty or not?
View ArticleDeleting a folder
Is there a way to remove a folder? Actually, in my do file I would like to zip a folder and delete the unzipped one. Somthing like below. The second command do not work because Arquivos_dbf is a...
View ArticleMean baseline survivor
Is there a way to calculate mean baseline survivor at the end of a specific time frame in stata? I tried predict survivor, basesurv but I couldn't get the meansurv. Thanks in advance. Jacob
View ArticleHow to loop through two objects at the same time
I have a varlist with 5 variables, d1, d2, d3, d4, and d5, and a macro with 5 variable labels, label1, label2, label3, label 4, and label5, how can I loop through the varlist and macro at the same time...
View ArticleAddressing autocorrelation and heteroskedasticity simultaneously in an...
Stata users, I have an unbalanced panel dataset where both autocorrelation and heteroskedasticity are problems. I have read, in the Stata manual, that the newey command (see Newey-West, 1987) is one...
View Articlepanel data unit root test and cointegration test
Dear Statalist, Now I am trying to analyze the relationship between public health expenditure, private health expenditure and gdp in Canada. I have the data for 13 provinces/territories from 1985-2014....
View Article