Compressing several loops
Hi all, I have the 16 loops below, that I want to compress it: HTML Code: mat Y = J(21, 32, .) forvalues i=1/21 { qui sum x if c`i'==1 & a1==1 matrix Y[`i',1] = r(min) matrix Y[`i',2] = r(max) }...
View Articletransposing rows to columns
Hi, My data contains multiple observations for the variable Dealsubtype, whereas I want to change the layout to be dealsubtype 1, dealsubtype 2, dealsubtype 3, etc.. Is there an easy way to transpose...
View Articlenearest neighbor matching
Dear all, I know that there are a lot of topics on this matter, but unfortunately I cant figure out how to do it in my particular case. This is my last resort, I really hope somebody can help me out. I...
View ArticleTrying to use pvarsoc to select lag for my pvar but error arise
I'm trying to analyze panel var model and want to select appropriate lag order for my data. But pvarsoc code doesn"t work for me. Even if I tried with example data from help pvarsoc, there is always...
View ArticleMerging few observations to copy/add for other observations
Hello, I am relative to Stata and I just cannot figure out how to solve the following problem. My master data set contains household information and my using data contains numbers of events per...
View Articletwopm: Two Part Models
I am using Stata 15 MP and my analytic data set is a geographic region-year panel, for the years 2000-2011, and 48 African countries (n=8,928). I am estimating a two part model using the twopm command....
View ArticleDifferent marginal effect for dummy variable after logit, depending on using...
Hello, I'm wondering why margins (after logit) produces different results for a dummy variable (0-1) depending on whether the i-prefix is used or not. Estimates of coefficients of smoke are (logically)...
View ArticleChange date variable to one stata can read
Hello Statalist, I've a question regarding my dataset. I want to extract the year and month separate from my "first_payment_date" variable but nothing seems to work. I have uploaded an attachment to...
View Articlegologit2 suddenly having problems in Stata 15
I have sent this problem to Stata tech support. I will be amazed if anyone on the list can help me but I figured I would toss it out just in case anyone has encountered a similar problem. My gologit2...
View ArticleR squared - Negative binomial
Hello everyone! I am currently performing some negative binomial regressions (xtnreg) with my panel data. I tried to measure the R squared but it seems that it is not really common when using a...
View ArticleChecking for Hetro in Longitudinal (Panel) Data
Good Day, I am trying to check for hetro issue in my longitudinal data where the N is large and P is small. I have run the following command: xtgls mig_dummy lagSPEI i.age_cat i.Gender , igls...
View Articletime variable mistake
Hi, I have a balanced panel data set with data, for each cross-section, up until 2016 (i=10, t=147). tsreport reveals that I have 9 gaps. tsreport, detail reveals that all gaps are at the Start of...
View ArticleLinear panel data: imposing MA(6) correlation errors
Hello Statalist! I'm doing an exercise from Microeconometrics Using Stata, by Cameron and Trivedi, Exercise 3 of Chapter 8 (page 278). "For the model and data of section 8.4, compare PFGLS estimators...
View ArticleNot displaying the F-Statistics and and Prob value when using robust command
Dear Statalist, I am having an balanced panel data set (banks profitability determinants factors) and using Fixed Effects with time dummy (after using testparm command). I run the multiple regression...
View ArticleMarginsplot not working
I would like to display a plot with the average marginal effect of nb_ygsibs5 with 95% CIs. This is what I do : Code: reg mort5 nb_ygsibs5 nb_ygsibs_fem female urban yob RBR birth_sp yobm twin educlvl...
View Articlevariable X not found in list of covariates
I have already read a lot of topic about this issue, but nothing has worked. I have my database with some variable. I want to calculate the marginal effect of W for a person with some characteristics....
View ArticleFactor variables may not contain noninteger values (r452)
Dear all, I have a longitudinal panel dataset and I am trying to add individual fixed effects to my specification with i.idd. idd identifies unique individuals throughout the years. When I add i.idd to...
View ArticleDelete Observations that have no partners in panel data
Hello.. i am new in here i got some problem in using STATA i am trying to make panel data but not every observations have complete year data -------------------------------------- copies | observations...
View ArticleConfusion About Reduced-Form Estimation
I'm using Stata 14 for Mac and I'm exploring a data set. It was going well but I've hit a wall. The question is phrased as such: "Estimate the hours equation as a standard Tobit model (Tobit I) on the...
View ArticleHotDeck results not reproducible
Hi everyone, I'm imputing data using HotDeck. gen income1 = income if treat == 0 hotdeck income1, store by(eligible) seed(1) impute(5) keep(income1 householdid) merge 1:1 householdid using...
View Article