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 […]

### Basic functions, split, string

# Splitting strings

## by Mitch Abdon • • 0 Comments

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 […]

### April fools, R, R-bloggers, RStata, Stata

# Stata Fully Mapped into R

## by Francis Smart • • 0 Comments

Hello all of you Stata loving statistical analysts out there! I have great news. I am finally nearly done with the package I have been working on which provides the mechanism for Stata users to seamlessly move from Stata to R though use of …

### Basic functions

# Rolling standard deviations and missing observations

## by Mitch Abdon • • 0 Comments

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 […]

### Uncategorized

# Rolling standard deviations and missing observations

## by Mitch Abdon • • 0 Comments

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 […]

### Uncategorized

# Rolling standard deviations and missing observations

## by Mitch Abdon • • 0 Comments

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 […]

### bias, OLS, omitted constant, regression, Simulation, Stata

# Omitting Constant may Introduce Biased Coefficients

## by Francis Smart • • 0 Comments

It is well known that dropping the constant in regression analysis may introduce bias. However, bias is really not the deeper issue. The deeper issue is that by omitting the constant, you are specifying a very specific form for the relationship b…

### Analytics, R, SAS, SPSS, Stata, Statistics

# SAS, SPSS, Stata Users: Learn R from Home April 21

## by Bob Muenchen • • 0 Comments

Has learning R been driving you a bit crazy? If so, it may be that you’re “lost in translation.” On April 21 and 23, I’ll be teaching a webinar, R for SAS, SPSS and Stata Users. With each R concept, … Continue reading →

### Analytics, R, SAS, Stata, Statistics

# Analytics Software Popularity Update: Counting Blogs, Simplifying Job Searches

## by Bob Muenchen • • 0 Comments

My latest update to The Popularity of Data Analysis Software is an attempt to use blog counts to estimate the popularity of analytics software. While I was able to greatly broaden the coverage of packages when studying job data, I … Continue reading →

### Analytics, R, SAS, SPSS, Stata, Statistics

# Job Trends in the Analytics Market: New, Improved, now Fortified with C, Java, MATLAB, Python, Julia and Many More!

## by Bob Muenchen • • 0 Comments

I’m expanding the coverage of my article, The Popularity of Data Analysis Software. This is the first installment, which includes a new opening and a greatly expanded analysis of the analytics job market. Here it is, from the abstract onward … Continue reading →

### Uncategorized

# Blah-blah-blah about do-files

## by Mitch Abdon • • 0 Comments

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 […]

### Uncategorized

# Blah-blah-blah about do-files

## by Mitch Abdon • • 0 Comments

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 […]

### Uncategorized

# Blah-blah-blah about do-files

## by Mitch Abdon • • 0 Comments

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 […]

### clustered standard errors, clustering, Simulation, Stata

# To Cluster or Not to Cluster – That is the Question

## by Francis Smart • • 0 Comments

Several very prominent econometricians have fallen on either side of thisquestion, typically they are concerned that the number of clusters issmall and the size in each cluster is large. One camp argues that theonly reasonable way of deriving con…

### basic commands, macros, Stata

# Batch Variable Rename – Stata

## by Francis Smart • • 0 Comments

* Using macros it is very easy to rename any number of variables in Stata.* Imagine you have a number of variables.clearset obs 10forv i=1/100 { gen var`=`i’^2′ = rnormal()}* We can rename variables by using a – mark which tells Stata to use* the vari…

### Basic functions

# Clever way to dummy

## by Mitch Abdon • • 0 Comments

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 = […]

### Basic functions

# Clever way to dummy

## by Mitch Abdon • • 0 Comments

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 = […]

### Basic functions

# Clever way to dummy

## by Mitch Abdon • • 0 Comments

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 = […]

### censored data, data, Stata, tobit

# Tobit fitted values not "fitting" data

## by Francis Smart • • 0 Comments

* I was recently asked by a reader why it might be that the predicted values from * a tobit regression might have a constant significantly below zero and many fitted* values unrealistically below zero.* Is that a problem?* Let’s do a simple simulation …

### data imputation, experimental method, Simulation, Stata, tobit

# Using Tobit to Impute Censored Regressors

## by Francis Smart • • 0 Comments

* Imagine that you have some data set in which one or more of your explanatory variables* is censored (that is x>alpha is reported as alpha). This type of censoring is typical* of some surveys such as income surveys when it might be possible to ide…

### R-bloggers, Stata

# A Call for Contributors

## by Francis Smart • • 0 Comments

Dear Readers,This blog has been going for a year and a half now and I have posted nearly 300 posts to date. I plan to continue to post though I am going to probably continue to shift my focus from daily blogging to that of getting a dissertation …