Posts Tagged ‘ Data Manipulation ’

Useful Functions in R for Manipulating Text Data

Useful Functions in R for Manipulating Text Data

Introduction In my current job, I study HIV at the genetic and biochemical levels.  Thus, I often work with data involving the sequences of nucleotides or amino acids of various patient samples of HIV, and this type of work involves a lot of manipulating text.  (Strictly speaking, I analyze sequences of nucleotides from DNA that are reverse-transcribed from […]

Read more »

How to Find a Job in Statistics – Advice for Students and Recent Graduates

How to Find a Job in Statistics – Advice for Students and Recent Graduates

Introduction A graduate student in statistics recently asked me for advice on how to find a job in our industry.  I’m happy to share my advice about this, and I hope that my advice can help you to find a satisfying job and develop an enjoyable career.  My perspectives would be most useful to students […]

Read more »

Three Quick and Simple Data Cleaning Helper Functions (December 2013)

December 6, 2013
By

As I go about cleaning and merging data sets with R I often end up creating and using simple functions over and over. When this happens, I stick them in the DataCombine package. This makes it easier for me to remember how to do an operation and others ...

Read more »

Slide: one function for lag/lead variables in data frames, including time-series cross-sectional data

May 21, 2013
By

I often want to quickly create a lag or lead variable in an R data frame. Sometimes I also want to create the lag or lead variable for different groups in a data frame, for example, if I want to lag GDP for each country in a data frame. I've found ...

Read more »

FillIn: a function for filling in missing data in one data frame with info from another

February 15, 2013
By

Update (10 March 2013): FillIn is now part of the budding DataCombine package. Sometimes I want to use R to fill in values that are missing in one data frame with values from another. For example, I have data from the World Bank on government deficits...

Read more »

Rolling Window Regression of Time Series

August 10, 2011
By
Rolling Window Regression of Time Series

We demonstrate a comparison among various implementations of Rolling Regression in SAS and show that the fastest implementation is over 3200X faster than traditional BY-processing approach.More often than not, we encounter a problem where an OLS over a...

Read more »

Regularized Discriminant Analysis

April 10, 2011
By
Regularized Discriminant Analysis

Demo SAS implementation of Regularized (Linear) Discriminate Analysis of J. Friedman (1989)[1]. Simpler introduction can be found at [2]. Regularized QDA follows similarly.To save coding, I called R within SAS to finish the computation. For details to ...

Read more »

Bayesian Computation with SAS (2)

February 1, 2011
By
Bayesian Computation with SAS (2)

In Chapter 2 of the book "Bayesian Computation with R" by Jim Albert, the philosoph of Bayesian statistics is introduced using an example where a parameter regarding proportion of heavy sleeping college students, i.e. those have more than 8 hours sleep...

Read more »

Bayesian Computation with SAS (1).

January 4, 2011
By
Bayesian Computation with SAS (1).

The book "Bayesian Computation with R" by Jim Albert is an easy to read entry level book on applied Bayesian Statistics. While the book was written for R users, it is not difficult to translate the languages between R and SAS and I believe it is a good...

Read more »

Table Look Up in SAS, practical problems

August 4, 2010
By
Table Look Up in SAS, practical problems

One guy asked in a SAS forum about a typical table look up problem: He has a data with two IDs: id1 id2 a b a e b c b e c e d e and he wants to generate a new data set with the following structure according to above information : id a b c ...

Read more »


Subscribe

Email:

  Subscribe