Functions with R The first step is to invoke the boot library >library(boot) The boot function need the following arguments: boot(data,statistic,R,arguments.

Slides:



Advertisements
Similar presentations
Review bootstrap and permutation
Advertisements

Uncertainty in fall time surrogate Prediction variance vs. data sensitivity – Non-uniform noise – Example Uncertainty in fall time data Bootstrapping.
Confidence Intervals, Effect Size and Power
Agricultural and Biological Statistics
RESEARCH METHODOLOGY & STATISTICS LECTURE 6: THE NORMAL DISTRIBUTION AND CONFIDENCE INTERVALS MSc(Addictions) Addictions Department.
Statistics Practice Quest 2 OBJ: Review standard normal distribution, confidence intervals and regression.
Business Statistics - QBM117 Selecting the sample size.
Dependent t-Test CJ 526 Statistical Analysis in Criminal Justice.
The Normal Distribution. Distribution – any collection of scores, from either a sample or population Can be displayed in any form, but is usually represented.
The standard error of the sample mean and confidence intervals How far is the average sample mean from the population mean? In what interval around mu.
Organizing Information Pictorially Using Charts and Graphs
1 (Student’s) T Distribution. 2 Z vs. T Many applications involve making conclusions about an unknown mean . Because a second unknown, , is present,
Stratified Random Sampling. A stratified random sample is obtained by separating the population elements into non-overlapping groups, called strata Select.
QM-1/2011/Estimation Page 1 Quantitative Methods Estimation.
Bootstrap spatobotp ttaoospbr Hesterberger & Moore, chapter 16 1.
Scot Exec Course Nov/Dec 04 Ambitious title? Confidence intervals, design effects and significance tests for surveys. How to calculate sample numbers when.
+ DO NOW What conditions do you need to check before constructing a confidence interval for the population proportion? (hint: there are three)
Introductory Statistics for Laboratorians dealing with High Throughput Data sets Centers for Disease Control.
7-1 Estim Unit 7 Statistical Inference - 1 Estimation FPP Chapters 21,23, Point Estimation Margin of Error Interval Estimation - Confidence Intervals.
Chapter 8 Estimation Nutan S. Mishra Department of Mathematics and Statistics University of South Alabama.
Statistics 101 Chapter 10. Section 10-1 We want to infer from the sample data some conclusion about a wider population that the sample represents. Inferential.
Estimation in Sampling!? Chapter 7 – Statistical Problem Solving in Geography.
CHAPTER 18: Inference about a Population Mean
MS 305 Recitation 11 Output Analysis I
P Values - part 4 The P value and ‘rules’ Robin Beaumont 10/03/2012 With much help from Professor Geoff Cumming.
9 Mar 2007 EMBnet Course – Introduction to Statistics for Biologists Nonparametric tests, Bootstrapping
General Confidence Intervals Section Starter A shipment of engine pistons are supposed to have diameters which vary according to N(4 in,
Limits to Statistical Theory Bootstrap analysis ESM April 2006.
11/23/2015Slide 1 Using a combination of tables and plots from SPSS plus spreadsheets from Excel, we will show the linkage between correlation and linear.
READING HANDOUT #5 PERCENTS. Container of Beads Container has 4,000 beads 20% - RED 80% - WHITE Sample of 50 beads with pallet. Population - the 4,000.
Confidence Intervals (Dr. Monticino). Assignment Sheet  Read Chapter 21  Assignment # 14 (Due Monday May 2 nd )  Chapter 21 Exercise Set A: 1,2,3,7.
STT 315 Ashwini maurya This lecture is based on Chapter 5.4 Acknowledgement: Author is thankful to Dr. Ashok Sinha, Dr. Jennifer Kaplan and Dr. Parthanil.
SAMPLE SIZE.
Normal Distribution Practice with z-scores. Probabilities are depicted by areas under the curve Total area under the curve is 1 Only have a probability.
 I can identify the shape of a data distribution using statistics or charts.  I can make inferences about the population from the shape of a sample.
Lecture 4 Confidence Intervals. Lecture Summary Last lecture, we talked about summary statistics and how “good” they were in estimating the parameters.
Essential Statistics Chapter 171 Two-Sample Problems.
+ Unit 5: Estimating with Confidence Section 8.3 Estimating a Population Mean.
Sullivan – Fundamentals of Statistics – 2 nd Edition – Chapter 2 Section 2 – Slide 1 of 37 Chapter 2 Section 2 Organizing Quantitative Data.
The accuracy of averages We learned how to make inference from the sample to the population: Counting the percentages. Here we begin to learn how to make.
The Normal Approximation for Data. History The normal curve was discovered by Abraham de Moivre around Around 1870, the Belgian mathematician Adolph.
Lecture 8 Resampling inference Trevor A. Branch FISH 553 Advanced R School of Aquatic and Fishery Sciences University of Washington.
Practical Solutions Analysing Continuous Data. 2 1)To produce the overall histogram you can use the options exactly as given. This results in the following.
Econ 110: Sampling Theory and Statistical Inference In Economics 2 nd semester 2016 richard makoto Economics Department University of Zimbabwe Normal Distribution.
Organizing Quantitative Data: The Popular Displays
CHAPTER 8 Estimating with Confidence

Statistical Intervals Based on a Single Sample
Chapter 10: Void Functions
Analyzing Redistribution Matrix with Wavelet
CJ 526 Statistical Analysis in Criminal Justice
AP Statistics: Chapter 7
Inferential Statistics
R Data Manipulation Bootstrapping
Since H is 4 units to the left of the y-axis,
Statistical Methods For Engineers
Interval Estimation.
Bootstrap Confidence Intervals using Percentiles
Using Statistics in Biology
Using Statistics in Biology
CHAPTER 18: Inference about a Population Mean
Change over time: Working with diachronic data
Basic Practice of Statistics - 3rd Edition Two-Sample Problems
Frequency Tables number of times something occurs
Cascaded Effects of Spatial Adaptation in the Early Visual System
CHAPTER 18: Inference about a Population Mean
Normal Distribution The Bell Curve.
CHAPTER 18: Inference about a Population Mean
Mar. 24 Statistic for the day: The number of heartbeats in a lifetime for any animal (mouse to elephant): Approximately 1 billion Assignment: Read Chapter.
Statistics in Biology: Standard Error of the Mean & Error Bars
Presentation transcript:

Functions with R The first step is to invoke the boot library >library(boot) The boot function need the following arguments: boot(data,statistic,R,arguments used by statistic) Data is the data you want to apply your statistic to. Statistic is a function that computes a specific TS, it must return a single value R is the number of bootstrap replication If the function computing the TS needs additional arguments, they can be provided as the last arguments

Creating the appropriate function to pass to the statistic argument The function boot uses the function provided in the statistic argument to sample “something” with replacement. In this course, we will only see the case when the “thing” sampled is subject. When your data are a single vector (see below), you sample elements boot.mean <- function(data,d) {data2<-data[d] bootmean<-mean(data2,na.rm=T) return(bootmean) }

Create a statistics function for SD

Applying boot on the function myData<-c(1,2,3,4,5,6,7,8,9,10) Res.boot<-boot(myData,boot.mean,R=200) Try this with the data on the first call on Day 2

Obtain the CI Boot.ci(Res.boot) Create a histogram of the TS in each bootstrap sample. The initial statistic will appear as a red line (col=“red”), with a width 3 times larger a normal line (lwd=3) >hist(Res.boot$t) Use print.default on the Res.boot to find the TS value in the initial sample, then: >abline(value of the initial TS,col=“red”,lwd=3)

Exercise: add vertical blue lines for the bca confidence interval

Obtaining a CI around a SD difference: interindividual variability in mood on Tuesday, call 1 vs call 6 Modify your function so that it indicates what to sample (hint: the rows since they represent your subjects) Then compute the SD across subjects for call 1 Tuesday and for call 6 Tuesday. Subtract one SD from the other. This gives you your TS that your new function should return. Apply boot

Exercise: draw a similar graph of the difference in intraindividual variability between Tuesday and Sunday Step 1: create the function that returns the TS Step 2: bootstrap the appropriate data Step 3: use boot.ci to obtain the CI Step 4: draw the graph