Quantcast
Channel: Statalist
Browsing all 73253 articles
Browse latest View live
↧

extract year, month, and day from a string variable

Hi, I have a string variable with the date in the following format Code: * Example generated by -dataex-. To install: ssc install dataex clear input long date 20170927 20170928 20170929 20171002...

View Article


Average time between artists' album releases in panel data

Dear Statalist. I have a panel data set containing artists, album releases by artists, and the year of each album release. I need to calculate a variable "wanted" that shows the average time between...

View Article


GMM estimation

Hi, I'm new in dynamics panel models and I need your help to organise my knowledge. I have 338 observations (13 years and 26 entities). I would like to build dynamics model but how should I step by...

View Article

Turning education into years of schooling

Hello everyone, I currently have a categorical variable for education ( let's call it educ) which is divided into the following categories: ---------+----------------------------------- Degree | 1,415...

View Article

xtabond and xtdpdsys

What is the difference between xtabond and xtdpdsys? What is better "onestep" or "twostep"? What if I first build fixed and random model and my data shows heteroskedasticity, serial correlation and...

View Article


Analyzing the data

Dear all. I am required to analyze the data on a project that requires answering the question: Why is the prevalence of a disease X higher in community A compared to comunity B? An invitation to...

View Article

Sargan or Hansen

Is it possible to use hansen test after xtabond? I estimated my model with xtabond....vce(robust) and I want to test validity of my instruments. Which tests are also better (Sargan or Hansen) after: 1)...

View Article

Simple wrapper for set trace

Edit: After some testing, it appears to be a scope issue; set trace on applies only to the context of the wrapper program. So, is there any way to make the effect of set trace apply globally? I am...

View Article


Using nlcom and lincom after margins

I have been attempting to compare the two items in a margins output table (calculated at a specific point for a continuous predictor), but instead of giving me the a difference between the items in the...

View Article


Legend option in Graph bar

Dear All, I want to make a graph bar over a categorical variable (4 categories). My data looks as follows: Code: Code: * Example generated by -dataex-. To install: ssc install dataex clear input...

View Article

Family Fixed Effects with large number of fixed effects

Hi Everyone, I am trying to run family fixed effects. I have a ton of mother ids to identifiy where kids are coming from, and I want to run reg y x i.momid But I keep getting an error that says I have...

View Article

How to use if statement in foreach loop?

I'm attempting to plot gas concentrations over time, but want to format the graphs differently for some of the gasses. My actually dataset is much larger, and I took a subset for the purposes of this...

View Article

Fitstat gives error message

Hi all, When I use fitstat after a ologit regression, I get this message: Code: . fitstat Measures of Fit for ologit of gnew variable cut1 not found r(111); It should work after ologit, right? Am I...

View Article


Creating Probability Variables

Hi, I have a set of variables indicating whether there was a recession in your year of birth or not (0 or 1). And also a variable that indicates your family size. Another variable that indicates...

View Article

strmatch and backslash

There seems to be something weird about strmatch, and I just can't find out what. I'm trying to match file names, and I stumbled on a problem that reduces to this: Code: . di strmatch("a/*","*/*") 1 ....

View Article


Change the lenght of a string

Hi, I have a dataset where the variable id is stored as a str9, although this id has only 8 characters of lenght in some registers. I have something like this (below). The id "00831782" has a lenght of...

View Article

Can I use multiple imputed data in a principle component analysis if my data...

Is it possible to use multiple imputed data in a principle component analysis if my data are not normally distributed? I found this helpful link: https://www.stata.com/support/faqs/s.../cmdok-option/...

View Article


Editing e() Results and Storing Results

Hi everyone, I'm running regressions, and wish to edit the results stored in e(b) or e(V) before storing the results. It is possible to extract e(b) and e(V) and edit them using standard matrix...

View Article

Testing interaction term?

Dear All, How can I test whether the interaction term (c.mpg#i.foreign) of the following regression is 0? Thanks. Code: sysuse auto, clear reg price mpg foreign c.mpg#i.foreign

View Article

Is there a command like -egen rowrandom()-?

Hi all, I have data set that look like this: Code: input str1 id x1 x2 x3 x4 x5 "A" 1 . 2 . 2 "B" 5 1 3 5 5 "C" 2 3 2 . 1 "D" . . . . . "E" 6 6 1 4 1 end Is there a command that creates a new variable...

View Article
Browsing all 73253 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>