Gravity Model: How to predict TOTAL VALUE of dependent variable from a...
Whilst I understand that a log-log gravity equation is the ELASTICITY of Y in relation to X, I am attempting to immotate British Treasury methodology in order to calculate the border effect between an...
View ArticlePredicted probabilities after multilevel model
I have a dataset from a survey consisting of individuals within states. I'm running a multilevel model of the form: melogit y x1 x2 x3 x4 x5 [pweight=weight] || state:, where y is a binary variable,...
View ArticleHow to use foreach and forvalues?
Hi, everyone. Lately I ran into a code writing problem. I am not very sure what is the difference between forvalues and foreach, and exactly how to use it in a loop. I have a variable items which is a...
View ArticleHow do I calculate average pairwise correlation?
Dear all, Hi, I have a dataset, where P_(i,j,t) is the stock price of firm i in sector j at time t. I am interested in, 1. calculating average pairwise correlation of stock prices between firms in the...
View ArticleEvent Study error "no observations"
Hello, dear StataList-ers! I'm running an Event Study (panel data) and have been using Princeton's "Event Studies with Stata " http://dss.princeton.edu/online_help...ventstudy.html as a reference. I've...
View ArticleSaving p-value on testnl to scalar
Hi everyone, I am trying to get the p-value associated with a one-sided test (that the coefficient from a nonlinear transformation via testnl) is less than zero. I've spent a while trying to get it to...
View Articlebysort descending
Dear users, I am trying to use the "gsort -" command to sort observations in descending order. The problem is that I need to order observations within sub-groups, and the "gsort" command does not seem...
View ArticleInterpretation of a continuous coefficient
Hey everybody, I did an regression and have some problems to interpret my results. My independent variable of interest is rank. The variables ranges between 0 and 1 but is not a dummy variable. Code:...
View ArticleTest for difference in means and median
Hi! Is there any simple method for testing differences in means and median?
View Articlemake indicator matrix in mata
Hi, i want to make a 0/1 matrix in mata based on some other matrix (in my example W) based on value of each element, so if it is greater than some value element should be 1 and otherwise 0.I can make...
View Articlemake indicator matrix in mata
Hi, i want to make a 0/1 matrix in mata based on some other matrix (in my example W) based on value of each element, so if it is greater than some value element should be 1 and otherwise 0.I can make...
View Articletreating a continuous variable as ordinal
my continuous dependent variable, which measures the percentage of women in ministerial cabinet positions, is bounded between 0 and 1. My initial regression analysis has highlighted that my dependent...
View ArticleRepeated time values within panel
Hi! I have a dataset that basically looks like this country year var1 var2 var3 var4 1 1995 2 2 1 8 1 1996 5 5 2 5 1 1997 4 4 3 5 ... 1 2012 4 4 4 7 2 1995 4 4 1 5 2 1996 7 5 9 7 2 1997 4 5 6 2 ... 2...
View ArticleRepeated time values within panel
Hi! I noticed I posted in the wrong forum, so I'm reposting it here. I have a dataset that basically looks like this country year var1 var2 var3 var4 1 1995 2 2 1 8 1 1996 5 5 2 5 1 1997 4 4 3 5 ... 1...
View ArticleGraphical presentation
Hi. I want to graphically show at what percentage (x axis) an event/outcome occurs (y-axis). Does anyone have any ideas how to do this? X-axis is a continuous variable and the outcome is binominal.
View Articleextract date file created
Hello, I would like to store the name and associated "date created" of a number of pdf files in a specific folder on my PC into a Stata file. I am using Robert Picard's filelist to extract the names of...
View ArticleUsing MATA to create a PDF: how can the PDF file size itself be controlled?
Dear Statalisters, Using the MATA command writepdf I create multiple PDF's. This works well, but I have a huge problem with the footprint of the (one page) PDF that is created by Stata: 58,601Kb!!!...
View ArticleInverse Proability Weighted Regression Adjustment - Models do not converge
I run several IPWRA models using the teffects ipwra command in stata with 4 outcome variables; Coffee production, Coffee income, Household income and Headcount poverty, against a large set of household...
View ArticleSaving parameters post estimation, by strata
Dear STATAlist, I have a, hopefully simple, query about storing parameters post estimation. I am doing the following to obtain odds of a binary outcome (tenmm) and mean age, both with standard errors,...
View Article"Drop by" using a frequency
Hello, I have the following problem: I want to drop some observations of one variable (in my case called "Mother's place of birth" or "mplbir") based on the frequency of a matching variable (here...
View Article