Tag Archives: statistics

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

Posted in Geekiness, Useless Knowledge | Also 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 [...]

Posted in (all categories), Geekiness, Useless Knowledge | Also tagged , , , , , | Leave a comment

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

Posted in (all categories), Geekiness, Useless Knowledge | Also tagged , , , , , , , , , , | 8 Comments

Sampling with replacement in R

In my last post about sampling (Simple sampling with R) we were doing simple sampling without replacement–that is, each item could only be selected once. However, there are times when you want to simulate sampling with replacement. For example, if you wanted to simulate sampling the results of rolling a dice 50 times, your outcomes [...]

Posted in (all categories), Geekiness, Useless Knowledge | Also tagged , , | 1 Comment

Simple sampling with R

I mentioned in an earlier post (Am I inconsistent?) that I got interested in R because Amy had asked me to help her with some sampling at one point. Since that was my starting point, I thought I would share some of my experiments with you. In this post: Simple random sampling Simple random sampling [...]

Posted in Geekiness, Useless Knowledge | Also tagged , , | 1 Comment

Am I inconsistent?

I won’t pretend that I don’t have any illegal software installed on my computers, but here are a couple of scenarios that have occurred at work recently. A student came to me with his new laptop and asked me “Can I have a copy of Office 2007?” I thought for a minute and said, “Um, [...]

Posted in (all categories), (non) fiction, Geekiness | Also tagged , , , , | 6 Comments