Blocking and Confounding
IEE 5160:
Design of Experiments & Regression Analysis
Dr. Lee Wells (Dr. Lee)
Wednesday, June 8, 2016
Blocking a Replicated 2 Factorial Design
Similar to single factor factorial design
Scenario: A 2 design has been replicated time
# The standard normal distribution in r
?pnorm
# pnorm(q) gives the area under the curve to the LEFT of q
# pnorm (q, lower.tail=FALSE) gives the area under the curve to the RIGHT of q
# pnorm (q, mean, sd , lower.tail=FALSE) gives the area under the curv
# we will need
package plyr, so first install that
# calculating 95% confidence intervals for a mean
#
# start with the brute force approach
#
# use the wolf teeth data (Ch 11 problem 6)
dist <c(10.2,10.4,9.9,10.7,10.3,9.7,10.3,10.7,10.1,10.6,10.3,10.0,10
# create a dataframe for the ch 15 problem 17 data
df <- read.csv(file.choose(), header=T)
str(df)
# for plotting it would be nice to have the levels of cyandensity be ordered
(low, med, high)
?factor
df <- transform(df,cyandensity=factor(cyandensity,leve
# election outcome example of paired t-test (ch 12, # 10)
# create vectors
outcome <- factor(rep(1:2,8),labels=c("W","L")
outcome
promises <- c(163,122,68,32,19,18,111,85,79,75,56,33,68,48,176,149)
promises
# although not needed, you could create a factor
# example where transformation is necessary
# use the heart transplant data from ALSM
df <- read.csv(file.choose(),header=T)
str(df)
# mismatch (the degree of mismatch between the patient and the donor heart)
should be ordered
df <transform(df,mismatch=fa
# weighted least squares example (ASLM ch 18 table 18.2)
# create a dataframe of the data
df <- read.table(file.choose(), header=T) # the datafile is a .txt file
str(df)
df
# make flux.type an ordered factor
df <- transform(df,flux.type=factor(flux.type,o
# partitioning the SS(Treatment) using orthogonal contrasts
# create dataframe from Keogh dataset
df <- read.csv(file.choose(),header=T)
str(df)
# check the number of observations in each treatment
# number of replicates of explanatory variable (BIOFILM)
# randomized complete block anova
# create a dataframe from the fat in diets data
# this is a .txt file, so we use the read.table function
df <- read.table(file.choose(), header=T)
str(df)
# plot the data
# this is also a good way check for block by treat
# install and load the package pwr
library(pwr)
# calculate power for the Daphnia example
pwr.anova.test(k=3,n=10,f=.6793,sig.level=0.05)
# brook trout problem (example 12.4)
df <- read.csv(file.choose(), header=T)
str(df)
df
library(ggplot2)
ggplot(df,ae
# create a dataframe for the wheat yield dataset
df <- read.table(file.choose(), header=T)
head(df) # just to take a peak at the data
str(df)
# need to make block, sowrate, and variety factors
df <- transform(df,
Block=factor(BLOCK),Sowrate=factor(SOWRATE
Chapter 3 problem 7
# create dataframe from Spider amputation data (Example 3.2)
df <- read.csv(file.choose(), header=T)
names(df)
str(df)
df
# add a new variable to the dataframe for the change in speed
df <- transform(df,speed.change=speed.after-speed.b
# calculate summary statistics (e.g., mean, SE, 95% CI) using summarySE
function
# package plyr must be installed
library(plyr)
# Summarizes data.
# Gives count, mean, standard deviation, standard error of the mean, and
confidence interval (default 95%).
# Comparison of chi-square and G-test
#
# Use data from Table 9.4-1
#
# Create a matrix of the data
fish <- matrix(c(1,49,10,35,37,9),nrow=2,ncol=3)
fish
# by default the matrix function fills the matrix by columns, so
# the above for fish is equivalent t
# chapter 8 problem 2
# create a vector of the data
x <- rep(0:6, c(103,72,44,14,3,1,1)
x
# obtain the mean number of parasites per fish
y <- mean(x)
y
# create a vector of the observed frequencies of the number of parasites per
fish
# because the frequen
Optimization
IEE 5160:
Design of Experiments & Regression Analysis
Dr. Lee Wells (Dr. Lee)
Wednesday, June 22, 2016
Methodology Example
Consider the following relationship in an industrial process
,
Investigate the conditions of temperature and pressure
Block Design
IEE 5160:
Design of Experiments & Regression Analysis
Dr. Lee Wells (Dr. Lee)
Wednesday, May 25, 2016
Blocking
Blocking is a technique for dealing with nuisance factors
Known
Controllable
Nuisance Factor
Has an effect on the response
Is o
Factorial Design
IEE 5160:
Design of Experiments & Regression Analysis
Dr. Lee Wells (Dr. Lee)
Wednesday, June 01, 2016
Factorial Design
An experimental design involving more than one factor
All possible combinations of factor levels are investigated
All
Response Surface Methodology
IEE 5160:
Design of Experiments & Regression Analysis
Dr. Lee Wells (Dr. Lee)
Monday, June 20, 2016
Multiple Linear Regression Models
Helpful to provide predictions of a response variable using
more than one predictor variable
Introduction
IEE 5160:
Design of Experiments & Regression Analysis
Dr. Lee Wells (Dr. Lee)
Monday, May 09, 2016
Outline
Syllabus review & course structure
eLearning
Class expectations
DOE introduction
History of DOE
IEE 5160 Design of Experiments & Regres
ANOVA
IEE 5160:
Design of Experiments & Regression Analysis
Dr. Lee Wells (Dr. Lee)
Wednesday, May 18, 2016
ANOVA Table
Source
Between
Treatments
Sum of Squares
2
Degrees
of Freedom Mean Square
1
1
0
=1
Error
Total
2
1
=1 =1
IEE 5160 Design of Exper
Hypothesis Testing
IEE 5160:
Design of Experiments & Regression Analysis
Dr. Lee Wells (Dr. Lee)
Wednesday, May 11, 2016
Hypothesis Testing Framework
A statement regarding the parameter(s) of a distribution or the
parameters of a model
0 : 1 = 2
1 : 1 2
I
Multiple Comparisons
IEE 5160:
Design of Experiments & Regression Analysis
Dr. Lee Wells (Dr. Lee)
Monday, May 23, 2016
ANOVA Example
An engineer wants to determine if four different methods of
estimating flood flow frequency produce different estimates o
Fractional Factorial Design
IEE 5160:
Design of Experiments & Regression Analysis
Dr. Lee Wells (Dr. Lee)
Wednesday, June 15, 2016
One-Half Fraction of the Design
In a factorial design, as the number of factors increases, the size
of the design grows sign
2 Factorial Design
IEE 5160:
Design of Experiments & Regression Analysis
Dr. Lee Wells (Dr. Lee)
Monday, June 6, 2016
2 Factorial Design
factors are considered
Each factor has 2 levels
There are 2 observations per replicate
Levels may be quantitative or
Statistics and Probability
IEE 5160:
Design of Experiments & Regression Analysis
Dr. Lee Wells (Dr. Lee)
Monday, May 09, 2016
Statistics and Probability
Statistics is the study of the collection, analysis, interpretation,
presentation, and organization of
Single Factor
IEE 5160:
Design of Experiments & Regression Analysis
Dr. Lee Wells (Dr. Lee)
Monday, May 16, 2016
Comparing Multiple Means
0 =
1 2
1
1
+
1 2
2
2
1
+
1
1
2
1
2
2 =
1 + 2 2
What about multiple factors or multiple levels?
EXAMPLE
Suppose we wa
# binomial test in R
# binom.test performs an exact test of a simple null hypothesis about the
# probabilty of successes in an experiment
Usage
binom.test(x, n, p = 0.5,
alternative = c("two.sided", "less", "greater"),
conf.level = 0.95)
Arguments
x
numbe
BIOS 5970
Homework #5
This assignment consists of the following 4 problems. It is worth 56 points, and is due in class on
Monday, March 21, 2016. Where appropriate, please provide R code and output.
Fiddler crabs are so called because males have a