User Tools

Site Tools


r-tutorial

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
r-tutorial [2011/10/13 00:43]
liuyipei
r-tutorial [2011/10/15 12:05] (current)
liuyipei [Problem Set 1 Hints]
Line 280: Line 280:
  
  
-====What I used to do assignment 1====+====Problem Set Hints and Other Tricks====
 <code> <code>
 setwd('/Users/liuyipei/BMI215/Module 1 - Nick/DrugSafety-Homework') setwd('/Users/liuyipei/BMI215/Module 1 - Nick/DrugSafety-Homework')
Line 291: Line 291:
 head(cd0) head(cd0)
  
-cd0<-data.frame(singlet=setdiff(as.character(unique(dz$singlet)), cd1),chole=0)+cd0<-data.frame(singlet=setdiff(as.character(unique(dz$singlet)), cd1$singlet),chole=0)
 cd0$chole<-'noncholes' cd0$chole<-'noncholes'
 cd.table<-rbind(cd1, cd0) cd.table<-rbind(cd1, cd0)
Line 324: Line 324:
 trapz(my.x, my.y) trapz(my.x, my.y)
  
-</code>+data.frame(a=c(8,12),b=c(31,41))->
 +
 +fisher.test(t)->f.t 
 +ls(f.t) 
 +f.t$p.value 
 +f.t$conf.int
  
 +</code>
r-tutorial.1318491814.txt.gz · Last modified: 2011/10/13 00:43 by liuyipei