Blog Archives

Export R Results Tables to Excel – Please don’t kick me out of your club

August 19, 2013
By
Export R Results Tables to Excel – Please don’t kick me out of your club

This post is written as a result of finding the following exchange on one of the R mailing lists:Is-there-a-way-to-export-regression-output-to-an-excel-spreadsheetQuestion: Is there a way to export regression output to an excel spreadsheet?Translation:...

Read more »

Question and Answer: Generating Binary and Discrete Response Data

August 19, 2013
By

I was recently contacted by a reader with two very specific questions and I thought that this would be a good topic to publicity respond to. He would like to simulate his data:I have firm level data and the model is discrete choice with the main expla...

Read more »

A Stata HTML syntax highlighter in R

August 12, 2013
By

So I have been having difficulty getting my Stata code to look the way I want it to look when I post it to my blog.  To alleviate this condition I have written a html encoder in R.  I don't know much about html so it is likely to be a little ...

Read more »

Item Equating with same Group – SAT, ACT example

August 5, 2013
By
Item Equating with same Group – SAT, ACT example

# Item equating is the practice of making the results from two # different assessments equivalent. This can be done by either# 1. having the same group take both assessments# 2. having equivalent groups take the different assessments# 3. having non-eq...

Read more »

Power Analysis by Simulation: R, RCT, Malaria Example

July 24, 2013
By
Power Analysis by Simulation: R, RCT, Malaria Example

I have received a number of requests for demonstration code on how to perform a power analysis using simulation in R.  I have already demonstrated howto do this in Stata but lacked the easy to use Stata command “simulate” that I preferred.  However, in a recent post I have written up a command very similar to simulate in...

Read more »

Loading up your custom toolkits at startup – R

July 22, 2013
By

If you are anything like me then you have dozens if not hundreds of personal functions that you have written to accomplish a number of tasks.  Many of the tasks that you would like to do are similar to previous tasks that you have already done. &n...

Read more »

Simulation of Blackjack: the odds are not with you

July 19, 2013
By
Simulation of Blackjack: the odds are not with you

I often want to simulate outcomes varying across a set of parameters. In order to accomplish this in an efficient manner I have coded up a little function that takes parameter vectors and produces results. First I will show how to set it up with some d...

Read more »

A Sudoku Puzzle Solver – attempt 1

July 9, 2013
By
A Sudoku Puzzle Solver – attempt 1

I have programmed up a R based Sudoku problem solver for Sudoku puzzles of that only require simple inference.  In these puzzles a solution can be found using only first order inference.  This solver can be found at the end of the code locate...

Read more »

Optimal Pricing for a Simple Monopolist

July 5, 2013
By
Optimal Pricing for a Simple Monopolist

# A single price monopolist is a monopolist because it is the only supplier of a particular product. The monopolist therefore has the power to choose a price to sell the product at. # Those who have a willingness to pay which is greater than the ...

Read more »

Zombie Apocalypse Survival Test – R-Powered (using Concerto)

June 17, 2013
By
Zombie Apocalypse Survival Test – R-Powered (using Concerto)

This test is the first attempt to seriously assess the ability of individuals to survive a zombie apocalypse.  This test is administered using the R powered open-source testing platform Concerto developed at the University of Cambridge. The t...

Read more »