d=read.table("http://www.biostat.umn.edu/~hanson/FundBiostat/bodytemp.txt",header=T,sep=",") attach(d) # now you can refer to 'rate', 'temperature', and 'gender' plot(rate,temperature,pch=gender) plot(rate,temperature,pch=c(109,102)[gender]) fit.m=lm(temperature[gender==1]~rate[gender==1]) # only pick out men summary(fit.m) plot(fit.m) fit.f=lm(temperature[gender==2]~rate[gender==2]) # women d=read.table("http://www.biostat.umn.edu/~hanson/FundBiostat/calcium.txt",header=T) attach(d) diff=oxalate-flame t.test(diff) d=read.table("http://www.biostat.umn.edu/~hanson/FundBiostat/bearings.txt",header=T) attach(d) both=c(TypeI,TypeII) group=c(rep('I',10),rep('II',10)) t.test(both~group)