Selecting column from r(table) based on column name
Hi all, I have an r(table) where the columns have names that stretch over three rows. I want to select one value in the r(table) and save it to a matrix. Normally, I would use: mat X=r(table) mat...
View Articlebysort egen - when observations contain missing value
Dear all, I am using bysort egen to compute the mean value by ayear and subcat_ccl (see data code below). clear input int(ayear gvkey pat) byte(subcat_ccl totCited) 1990 1000 10001 69 9 1990 1002 30001...
View Articleproblem with malmq (author written ado to calculate malmquist)
I use malmq to calculate malmquist in stata14, but it could not save the result to a file. The program is as follows: use "E:\chi11_lee_files\lee2.dta" malmq i_AC = O_SPI O_CPI,period( time)...
View ArticleGeometric Mean: Bugs in meanrets Package for Portfolios?
I was using the mvport package (SSC) written by Alberto Dorantes. The package has meanrets program for finding geometric mean, however, its results seem to be upward biased, I cross checked it with MS...
View ArticleTitle: Running Poi’s Quaids manually with nlsur. Problem with computing price...
Dear All I would really appreciate some help on this. I am using Stata 13 I need to run quaids model manually using nlsur for a four good model to estimate income and price elasticity. Following is how...
View ArticleChow Test for known Structural Breaks.
Hi everyone, I'm doing my Master Thesis in Economics using Stata 13. I'm working with a Panel data set( strongly balanced) and i would like to do a Chow Test, to control for structural break since my...
View Articlextmg - augmented mean group estimator AMG
Hey everyone, I am estimating the following model consisting of 29 OECD-countries over 23 years lnC = lnP+lnY+lnU+lim+com The overall objective is to determine if an advertising bans reduces tobacco...
View ArticleHow to calculate intersection point of two graphs
Hi Statalisters, I am using margins command to see effect of interaction term and subsequently I am interested in calculating the point at which below two lines intersect. I run the model first using:...
View ArticleConditional Logit with Nonlinear Constraints
Dear All, I am trying to build maximum likelihood estimator for conditional logit, with nonlinear constraints on parameters. Until now, I am able to write a method d0 program that has the same results...
View Articlegetprime package now available at SSC
Thanks to Kit Baum, as always, getprime is now available on SSC. The package includes two commands you can use:getprime: this command allows you to get the prime number closer to the number you pass....
View ArticleError message sample may not include multiple panels
I am trying to use ivregress and ivreg2. When I use the option for autocorrelation consistent (bw, hac) I got error messages that the: "sample may not include multiple panels", or "variable NAME not...
View Articleif command inside foreach
Hi. What is the problem with the code below? I would like to use if command inside foreach, but stata seems to not recognize it. : foreach i in BRSSE SE { use ST_BR_T, clear keep cnes anomes d_sus...
View ArticleForeach loop help
Hi, I have some questions of combing lines of codes into one. The 8 variables c21-c28 are all dummy variables with 0 and 1 values. There are 1s in multiple variables. But I want, for example, c28=0 if...
View Articleit is possible to generate a double by?
Hello everyone, I'm working with a dataset of trade information. I have a variable with the import of the transaction by id, by country and by product. If a company exported wood to 10 different...
View ArticleSaving ADF output as table
log using "C:\Users\nityaaasaavari\Desktop\FXI\df_default.te xt", replace text foreach X of varlist usd_inr lusd_inr lag_lusd_inr dlusd_inr lag_dlusd_inr spotbn { dfuller `X', lags(5) regress } log...
View ArticleSurvival Analysis
Hi everyone I am a beginner with Stata and trying hard to learn how to work it out. I am trying to use Stata 14 to answer the following question: Does hypertension come with a risk for CHD that isn't...
View ArticleDataset with duplicates and different values for the same variable
Hi, I was provided with a dataset of 4223 observation that contains duplicates ( copies >1; copies=2; copies=4 and copies=5). Seems that for 155 observations per person there are different values(...
View ArticleFE-estimation: R-squared lower with variables in first differences
Hey everyone, I am using the FE-estimtor, first with variables in log-levels and then with variables in log-first-differences. Using first differences, the R-sqaured is much lower. IN LEVELS: xtreg...
View Articlespmap basemap problems
When I cut down Maurizio's Italy basemap to just 6 points it works fine with a simple master. +----+ | id | |----| 1. | 1 | 2. | 2 | 3. | 3 | +----+ +-----------------------------+ | _ID _X _Y |...
View ArticleError message while trying to reset memory
Hi I'm trying to use the 'spagplot' command to create a spaghetti plot as follows: spagplot hbA1cx J, id(nhs), if age<19 & diagdate>date("12/10/2015", "DMY") But I get the following error...
View Article