Variance in Multilevel Multinomial Logit Model using Gllamm
Hello Stata users, I am using gllamm to specify a multilevel multinomial logit model where people's responses to a survey (level 1 variables) are nested within meetings (level 2) where these surveys...
View ArticleCan you open Stata file from the filesystem without moving the the file's...
The default behavior of Stata when opening a file from the filesystem (by double clicking them, or otherwise invoking the system's open command) is for Stata to load the file from the full path and...
View ArticleOLS Regression with FE, robust, and clustering
Hi, I'm looking for a command or a package that absorbs multiple variables' fixed effects, can handle robust standard errors, and multiple-way clusters. Is Stata capable of running such a regression?...
View Articlegrc1leg: positioning b1title above common legend
Hello everybody, I am trying to combine two line graphs with the user-written command grc1leg by Vince Wiggins. Well, I am using it because I want only one common legend for both graphs, which works...
View ArticleConvert string variable date of birth into a numeric variable
Hi, I have a variable (pt_dob) as a string variable (which is red in data editor). I want to calcuate age (which is a numeric variable) based on pt_dob variable. I read about the command "date" can...
View ArticleIF loop within a WHILE loop and cumulating info into a vector
Hi, there seems to be a problem with the while loop below, although there are no specific error messages that lead me to understand the problem. I am estimating beta with Ordinary Least Square...
View Articleaxis ticks as functions of actual values
Dear all, Hi, I'm plotting y vs. x. Can I use axis ticks that are functions of x? So, if we plot y vs. x and the x-axis ticks are 1, 2, 3, 4, 5, can I force display 1, 4, 9, 16, 25 (so ticks are x^2)?...
View ArticleNumbering sequential visits, even with multiple data rows per visit
Hello, the following simulation uses the command Code: bysort var1(var2): generate var3=_n to create, within subject ID, sequential numbers for each successive clinic visit. However, note that the...
View ArticleRegression after propensity score matching
Hi everyone. I would need your help with the following I'm running a dif-in-dif analysis and the first stage is to match each observation in the treated group with one ob in the control group by...
View Article"<" operator generates a value of "="
Hi, When I created categories for numeric data, the categories don't match with the criteria used to group them . I used the following codes: gen tccat=1 if tc<5.2 replace tccat=2 if tc>=5.2...
View ArticleConverting Peculiar Date & Time From String To Datetime
Hi there, How do I convert the string value "06/06/16 09:04 PM" to a datetime format? I've tried clock(varname, "MDYhm") but this doesn't work. Thank you in advance! Erika
View ArticleStandardized (beta coefficients) estimation's degrees of freedom?
Hi guys, I was preparing the topic of data scaling for my class today and I came up with an issue that I'm not sure what to think. Let's say we want to do a regression to estimate the beta...
View Articlemultilevel data and rare events
Hi everyone, I have data with a nested structure, and am running two separate multilevel logistic regression models (my dependent variable is binary). The problem is that, for both models, the number...
View ArticleAutomatic output names
Dear forum members, my goal would be to save the matrix wk to wk_1995.txt; wk_1996.txt and so on. Unfortunately saving the value of the scalar `L' is not recognized by STATA and neither is renaming it...
View Articleaverage marginal effect after blogit results in different signs of...
Dear Statalist, I am using Stata 12 blogit with an interaction term that has a positive coefficient (0.0047215), yet the average marginal effect is negative (-551.4792). I am not sure why this paradox...
View ArticleEstimating percentile ranking for number not in distribution
Hi, I have a data set of simulated treatment estimates and I want to see where another treatment estimate not in the data set falls in this distribution. I tried to use pctile to estimate the...
View Articlesvy command for survey data without PSU information
Hi, I have a question about using svy command. I have a cross-country dataset which contains weight variable but no information on the PSU or strata. Moreover, different sampling frames, stratification...
View ArticleScientific notation on histogram with frequency option
I need to use the frequency option with a histogram. Many observations are clustered in a bin at one end of the x range, which gives a high count for that bin. By default, large frequencies are shown...
View Articletuples vs nested loops for order of macro list
Hello Statalisters, I'm attempting to run some simulations that alternate the number of stratification factors within a randomisation plan, and have approached a cross-roads as to which direction I...
View Articleprobit on a subsample for teffect psmatch
Dear Stata user, I'm using stata 14 to estimate the effect of public aids on the recipients. In order to do that, I'm using psmatch2 and teffects psmatch. My issue is that I have a very small number of...
View Article