Statalist, too, has a new home

If you have been following Statalist (see Stuck? Hello Statalist), the email-based support system for Stata users, you must have long known that it has moved to a new home and a new format. Statalist is now a forum hosted at maintained by StataCorp but moderated by a “friendly group” (quoted from the site) of […]

The post Statalist, too, has a new home appeared first on Stata Daily.

Splitting strings

In -destring- complication, Anup asked how to split a string variable. In his case, he has a variable of the form 28-18-0018-02183100-02-O-B where 28 represents state code, 18 represents districts code, 0018 represents subdistricts code and 02183100 represents village code. His problem is how to extract the state, districts, etc. codes separately from the variable and label all the […]

The post Splitting strings appeared first on Stata Daily.

Rolling standard deviations and missing observations

In And we’re rolling, rolling; rolling on the river, Hasan asked how he could “keep only those values that were calculated using at least 3 observations” after he calculated the 4 period rolling standard deviation of a set of observations. One solution is to tag the periods when the missing observations within the window (in […]

Blah-blah-blah about do-files

Data analysis in Stata may be carried out by interactive mode using the Command window, by using the drop down menu, or by executing a set of Stata commands written in a do-file. It is most likely that you will be using a combination of these rather than using one method exclusively. Making use of […]

You Broke Peer Review. Yes, I Mean You

| Gabriel | I’m as excited as anybody about Sociological Science as it promises a clean break from the “developmental” model of peer review by moving towards an entirely evaluative model. That is, no more anonymous co-authors making your paper worse with a bunch of non sequiturs or footnotes with hedging disclaimers. (The journal will […]

Clever way to dummy

Relational operators (>, <. >=, <=, ==, !=) evaluate to 1 if the expression is true and 0 if false. Given this definition, a dummy variable can be created using, for example: gen newvar = (oldvar <= somethreshold) if !missing(oldvar) Instead of the longer alternative: gen newvar = 1 if oldvar <= somethreshold replace newvar = […]

A Licensing Opportunity

| Gabriel | 1st of March, 1600 Anno Domini To his majesty Felipe Hapsburg III, His majesty Christian den Fjerde, king of Denmark-Norway, sends you greetings and congratulations on your recent ascension and wishes your reign to extend peace and prosperity to Spain. We are writing to alert you that your realm’s “New Spain” project infringes […]