Stata Blogger?

Are you a Stata blogger? Join the aggregator!

MSimulate Command

CLT is a powerful property* Stata has a wonderfully effective simulate function that allows users to easily simulate data and analysis in a very rapid fashion.* The only drawback is that when you run it, it will replace the data in memory with the simu…

Continue reading MSimulate Command

Now on Stata-bloggers…

Francis Smart has set up Stata-bloggers, a new blog aggregator for Stata users (modeled after R-bloggers). FE will be contributing there, but there’s lots of other goodies worth checking out from more prolific bloggers.Everyone say “Thank you, Fra…

Continue reading Now on Stata-bloggers…

Plotting restricted cubic splines in Stata [with controls]

Michael Roberts has been trying to convince me to us restricted cubic splines to plot highly nonlinear functions, in part because they are extremely flexible and they have nice properties near their edges.  Unlike polynomials, information at one e…

Continue reading Plotting restricted cubic splines in Stata [with controls]

Quickly plotting nonparametric response functions with binned independent variables [in Stata]

Yesterday’s post described how we can bin the independent variable in a regression to get a nice non-parametric response function even when we have large data sets, complex standard errors, and many control variables.  Today’s post is a …

Continue reading Quickly plotting nonparametric response functions with binned independent variables [in Stata]

Binning a continuous independent variable for flexible nonparametric models [in Stata]

Sometimes we want to a flexible statistical model to allow for non-linearities (or to test if an observed relationship is actually linear). It’s easy to run a model containing a high-degree polynomial (or something similar), but these can become c…

Continue reading Binning a continuous independent variable for flexible nonparametric models [in Stata]

Prettier graphs with less headache: use schemes in Stata

I’m picky about graphs looking nice. So for a long time I did silly things that drove me nuts, like typing “ylabel(, angle(horizontal))” for every single Stata graph I made (since some of the default settings in Stata are not pretty). I always knew tha…

Continue reading Prettier graphs with less headache: use schemes in Stata

Plot polynomial of any degree in Stata (with controls)

FE has been a little sluggish to recover from break. To kick start us back in gear, I’m making good on one resolution by making this FE Week-of-Code. I’ll try to post something useful that I’ve written from the past year each day.It always bugged me th…

Continue reading Plot polynomial of any degree in Stata (with controls)

Checking for differences in estimates by group

Stata do file* Imagine that you have two groups in your sample and you are wondering if both groups respond the explanatory variables in the same manner.clearset obs 1000gen group=rbinomial(1,.5)gen x = rnormal()gen y = 2 + 3*x + rnormal()*2 if group==…

Continue reading Checking for differences in estimates by group

Path Analysis

Stata do file* Path analysis is an interesting statistical method that can be used to indentify complex relationships beween variables and an outcome variable.* As with all statistical methods the modelling framework is essential to derive reasonable r…

Continue reading Path Analysis

Visually-Weighted Regression

[This is the overdue earth-shattering sequel to this earlier post.]I recently posted this working paper online. It’s very short, so you should probably just read it (I was actually originally going to write it as a blog post), but I’ll run through…

Continue reading Visually-Weighted Regression