Monday, October 11, 2010

Sample Size calculations for Longitudinal and Mixed Effects Models (RMASS)

Here is a link to RMASS online (much easier to use than the DOS version):
http://www.healthstats.org/rmass/

Directions to the Biostatistics Consulting Laboratory

We are located on the third floor of the R corridor in the Medical Center. 

Take the stairs next to the Student Care Center to the third floor. The R corridor on the third floor is disconnected from the rest of the building so these are the only stairs that will lead you to our offices.





Thursday, October 7, 2010

how to drop unused levels in R

problem.factor <- problem.factor[, drop = TRUE]



To drop unused levels from all factors in a data.frame, use this function:


drop.levels <- function(dat){
  # Drop unused factor levels from all factors in a data.frame
  # Author: Kevin Wright.  Idea by Brian Ripley.
  dat[] <- lapply(dat, function(x) x[,drop=TRUE])
  return(dat)
}

from http://rwiki.sciviews.org/doku.php?id=tips:data-manip:drop_unused_levels

Wednesday, October 6, 2010

how to paste data into R

copy the data into the clipboard (Ctrl-C or Command-C)


in the R console run: mydata = read.table(file="clipboard")


For some versions of R, this does not work. Try


mydata = read.table(pipe("pbpaste"))



EndNote Training

I've been using Mendeley reference management software quite a bit, but it's just too early to give up EndNote completely.  Fortunately, Crerar Library offers EndNote Training session next week - I went to one of those last year, and it eased some of  frustration.

https://training.uchicago.edu/course_detail.cfm?course_id=320

Monday, October 4, 2010

Special Characters in Stata Graphs

Here is a code snippet showing how to insert symbols (e.g. Greek letters or subscripts) in Stata graphs:

local xt2="Max({&Delta}T{subscript:1}-{&Delta}T{subscript:0})"
scatter avegr a1diff1, xt(`xt2') yt("Ave Grade") ///
  ti("Ave Grade vs. Max({&Delta}T{subscript:1}-{&Delta}T{subscript:0})")


Friday, October 1, 2010

Quantile Regression

Just came across this non-technical introduction to quantile regression by Roger Koenker and Kevin Hallock. 

http://www.econ.uiuc.edu/~roger/research/rq/QRJEP.pdf

R working environment in Windows: Eclipse + StatET plugin

I currently use Tinn-R as my main editor, but it has limitation and there are some things that I don't like about it.  Here is a description of how to set up an R working environment in Windows using Eclipse and the StatET plugin (I haven't tried it yet, but it looks very promising).

http://www.splusbook.com/R_Eclipse_StatET.pdf

What is Eclipse, you ask? Here is an FAQ on the subject.

Subscribe via email

Enter your email address:

Delivered by FeedBurner

Followers

google analytics