Category Archives: Geekiness

Stratified random sampling in R from a data frame

After a little bit more work, there’s a new stratified random sampling function, this one letting you sample from a data frame, returning all the variables for each of your samples as a nice data frame that you can continue working on as usual. Get the function at http://news.mrdwab.com/stratified. Usage notes in the head of [...]

Also posted in Useless Knowledge | Tagged , , , , , | 4 Comments

Stratified Random Sampling in R–A Function in Progress

IMPORTANT: This is here mostly to remind me of how I solved my problem. You should read Stratified random sampling in R from a data frame if you really want to use this function. I know that sampling is quite complex, and I will admit that I know very little about its complexities. Fortunately, software [...]

Also posted in (all categories), Useless Knowledge | Tagged , , , , , , | Leave a comment

Reshaping data in R revisited

A year ago, I wrote a post about reshaping data from a wide format to a long format. I thought that considering how much time had passed, it would be good to revisit R’s in-built reshape functions. For these examples, I’ve copied the Stata examples from the UCLA Academic Technology Services’s “Reshape data wide to [...]

Also posted in Useless Knowledge | Tagged , , , , | Leave a comment

Regular expressions in R

In my last post (Sounds interesting. Is that a regular expression?), I showed a few things I had figured out recently related to regular expressions. By now, you have also figured out that I like figuring things out in R, and application of regular expressions is one of these things.

Also posted in Useless Knowledge | Tagged , , | Leave a comment

Sounds interesting. Is that a regular expression?

I’ve been meaning to learn how to use regular expressions for quite some time now, but just never seemed to get around to doing so. The other night, I decided to take a stab at them though, and over the past few days, I’ve sort of managed to learn a few tricks. Some of these [...]

Also posted in (all categories), Useless Knowledge | Tagged , , | Leave a comment

Spectrum: An exploration into open-source publishing

Yesterday, at DHAN Foundation’s “Foundation Day” celebration, the students from PDM 11 of the Tata-Dhan Academy and others were able to have–after a really long break–a new issue of Spectrum: Colours of Development in their hands to look at (and hopefully read). Spectrum is the student newsletter of the Academy; students contribute articles, solicit articles [...]

Also posted in (all categories), India, OpenOffice.org | Tagged , , , | Leave a comment

The new sample size calculator for R (already)

aka “Maybe I shouldn’t post so quickly” Just hours ago, I posted my first set of functions for R to determine the sample size for a known population. Then, I had to update that post to reflect my newfound knowledge, and now, I thought I would update again, so that the best functions I came [...]

Also posted in (all categories), Useless Knowledge | Tagged , , , , , | 7 Comments

A sample size calculator function for R

IMPORTANT: This is here mostly to remind me of how I solved my problem. You should read The new sample size calculator for R (already) if you really want to use this function. In the research class at the Tata-Dhan Academy, students are currently getting into sampling, so I thought I would introduce them to [...]

Also posted in (all categories), Useless Knowledge | Tagged , , , , | 2 Comments

Using the reshape package in R for pivot-table-like functionality

A little more than a week ago, I wrote about creating pivot tables in Microsoft Excel and OpenOffice.org. I also mentioned that I would explain how to do similar calculations by using R. This post will explain how to achieve similar results in R by using the reshape package. I had initially started experimenting with [...]

Also posted in (all categories), Useless Knowledge | Tagged , , , , , , , , , , , | 8 Comments

Pivot Tables in Excel and OpenOffice.org Calc

One of the features I find useful in Excel is the ability to create “pivot” tables. Essentially pivot tables let you summarize big tables of data in different ways, using different variables to “pivot” your data around (hence the name, I guess). Pivot tables are most easily understood through an example, so here’s one done [...]

Also posted in (all categories), OpenOffice.org, Useless Knowledge | Tagged , , , , | Leave a comment