Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 27 lines (16 sloc) 0.61 kB
4bdaa5e Initial commit.
Kevin Middleton authored
1 library(boot)
2
3 # use gdata for Mac, xlsReadWrite for Windows
4 library(gdata)
5 #library(xlsReadWrite)
6
7 # Read the file. Change the path to be the path
8 dat <- read.xls("/Users/kmm/Desktop/lobke2.xls", header = FALSE)
9
10 # Rename the columns
11 names(dat) <- c("age", "grp", "sex")
12
13 set.seed(112)
14 (median.all <- boot(dat$age, function(x, i){median(x[i])}, 10000))
15 mean(median.all$t)
16
17 (median.ca <- boot(dat$age[dat$grp == "CA"], function(x, i){median(x[i])}, 10000))
18 mean(median.ca$t)
19
20
21 boot.ci(median.all)
22
23 y <- sort(median.all$t)
24
25
26 write.table(median.all$t, file = "outfile.txt", row.names = FALSE, col.names = FALSE)
Something went wrong with that request. Please try again.