Question 1

Lab1 <- read.csv("~/R/DataHouse/anth.550/Lab 1 results.csv")

forward <- psych::describe(Lab1$RS[1:6],na.rm=T)
reverse <- psych::describe(Lab1$RS[7:12], na.rm=T)
combined <- psych::describe(Lab1$RS[1:12], na.rm=T)

table1 <- rbind.data.frame(forward, reverse, combined)
table1 <- round(table1,2)
rownames(table1) <- c("forward", "reverse", "combined")
CVf <- table1[1,4]/table1[1,3]*100
CVr <- table1[2,4]/table1[2,3]*100
CVc <- table1[3,4]/table1[3,3]*100
CV <- rbind.data.frame(CVf,CVr,CVc)
table1 <- cbind.data.frame(table1[2:4],CV,table1[,c(5,8:10)])
colnames(table1)[4] <- "CV %"
table1[,c(2,5:8)] <- round(table1[,c(2,5:8)],0)
table1[,3:4] <- round(table1[,3:4],2)
knitr::kable(table1, format = "markdown")
n mean sd CV % median min max range
forward 6 8871 388.79 4.38 8902 8211 9258 1047
reverse 6 9215 96.45 1.05 9220 9102 9353 252
combined 12 9043 324.40 3.59 9159 8211 9353 1142

Question 2

m.class <- mean(colMeans(Lab1[1:12,2:14]))
error.mydata <- round((abs(table1[3,2]-m.class)*100)/m.class,2)

clas <- reshape(Lab1[1:12,2:14],direction = "long", varying =list(names(Lab1)[2:14]))
s.clas <- sd(clas[,2])
m.clas <- round(mean(clas[,2]),0)
c.CV <- round(s.clas/m.clas,2)*100
m.clas
## [1] 8886
c.CV
## [1] 4

The inter-tester CV for the class was 4% and the percentage error of my data = 1.77%

Question 3

concentration <- c(200,100,50,25,12.5, 6.25,200,100,50,25,12.5, 6.25)
cpm <- Lab1$RS[13:24]
dilution.type<- Lab1$X[13:24]
Lab1.a <- cbind.data.frame(dilution.type,concentration,cpm)

lm_eqn <- function(y, x, df){
    m <- lm(y ~ x, df);
    eq <- substitute(italic(y) == a + b %.% italic(x)*","~~italic(r)^2~"="~r2, 
         list(a = format(coef(m)[1], digits = 2), 
              b = format(coef(m)[2], digits = 2), 
             r2 = format(summary(m)$r.squared, digits = 3)))
    as.character(as.expression(eq));                 
}

xx <- lm_eqn(cpm[1:6],concentration[1:6],Lab1.a)
yy <- lm_eqn(cpm[7:12],concentration[7:12],Lab1.a)


library(ggplot2)
p1 <- ggplot(Lab1.a, aes(x = concentration, y = cpm, color = dilution.type)) + 
   geom_point() + geom_smooth(method = "lm")
p1 <- p1 + xlab("Volume of Tracer")
p1 <- p1 + ylab("cpm")
p1 <- p1 + geom_text(x = 100, y = 100, label = xx, parse = TRUE, color ="lightseagreen")
p1 <- p1 + geom_text(x = 100, y = 15000, label = yy, parse = TRUE, color ="coral")
p1 <- p1 + labs(title="Diluton to CPM for pipeting lab") +theme_bw()
p1

#manual dilution correlation
cor.test(Lab1.a$concentration[1:6],Lab1.a$cpm[1:6])
## 
##  Pearson's product-moment correlation
## 
## data:  Lab1.a$concentration[1:6] and Lab1.a$cpm[1:6]
## t = 75.906, df = 4, p-value = 1.805e-07
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  0.9966697 0.9999639
## sample estimates:
##       cor 
## 0.9996531
#serial dilution correlation
cor.test(Lab1.a$concentration[7:12],Lab1.a$cpm[7:12])
## 
##  Pearson's product-moment correlation
## 
## data:  Lab1.a$concentration[7:12] and Lab1.a$cpm[7:12]
## t = 87.421, df = 4, p-value = 1.026e-07
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  0.9974880 0.9999728
## sample estimates:
##       cor 
## 0.9997384

Question 4

Lab1.a[,1] <- droplevels(Lab1.a)[,1]
levels(Lab1.a$dilution.type) <- c("md","sd")
l2 <- cbind.data.frame(Lab1.a[1:6,3],Lab1.a[7:12,3])
l2 <- round(l2,2)
r.means <- round(apply(l2,1, mean),2)
r.sd <- round(apply(l2,1,sd),2)
CV2 <- r.sd/r.means
CV2 <- CV2*100
l3 <- cbind.data.frame(Lab1.a[1:6,1],Lab1.a[1:6,2],Lab1.a[1:6,3],Lab1.a[1:6,4],Lab1.a[1:6,5],Lab1.a[7:12,1],Lab1.a[7:12,2],Lab1.a[7:12,3],Lab1.a[7:12,4],Lab1.a[7:12,5],CV2)
colnames(l3)<- c("type","dilution","observed","expected","% error","type","dilution","observed","expected","% error", "CV%")
l3[,c(-1,-6)] <- round(l3[,c(-1,-6)],2)
l3[,c(3:4,8:9)] <- round(l3[,c(3:4,8:9)],0)
l3[,7] <- c("1:1","1:2","1:4","1:8","1:16","1:32")
knitr::kable(l3, format = "markdown")
type dilution observed expected % error type dilution observed expected % error CV%
md 200.00 17769 17769 0.00 sd 1:1 17992 17992 0.00 0.88
md 100.00 9280 8885 4.45 sd 1:2 8580 8996 4.62 5.55
md 50.00 4544 4442 2.29 sd 1:4 4448 4498 1.11 1.51
md 25.00 2082 2221 6.27 sd 1:8 1999 2249 11.12 2.87
md 12.50 1143 1111 2.94 sd 1:16 972 1124 13.59 11.47
md 6.25 630 555 13.40 sd 1:32 495 562 11.89 16.88

Question 5

Lab.b <- Lab1[25:34,]
Lab.b$X <- droplevels(Lab.b$X)
m.5 <- tapply(Lab.b$RS,Lab.b$X,mean)
sd.5 <- tapply(Lab.b$RS,Lab.b$X,sd)
CV3 <- sd.5/m.5*100
l4 <- cbind.data.frame(m.5,CV3)
cm <- l4[,1]-l4[4,1]
Total <- cm/l4[5,1]*100
tc2 <- l4[5,1]*c(1/100,1/500,1/5,NA,1)
observed <- cm
p.error <- abs(observed-tc2)*100/tc2
l4 <- cbind.data.frame(m.5,CV3,cm,Total,observed,tc2,p.error)
l4 <- rbind.data.frame(l4[4,],l4[5,],l4[3,],l4[1,],l4[2,])
colnames(l4) <- c("mean","CV%","Corrected Mean", "% Total","Observed", "Expected", "% Error")
rownames(l4)[3]<- "1:5"
l4[,c(1,3,5,6)] <- round(l4[,c(1,3,5,6)],0)
l4[,c(2,4,7)] <- round(l4[,c(2,4,7)],2)
knitr::kable(l4, format = "markdown")
mean CV% Corrected Mean % Total Observed Expected % Error
BKG 0 NaN 0 NaN 0 NA NA
TC 0 NaN 0 NaN 0 0 NaN
1:5 1742 6.29 1742 Inf 1742 0 Inf
1:100 54 17.61 54 Inf 54 0 Inf
1:1000 10 94.72 10 Inf 10 0 Inf

Question 6

I would use 2 \(\mu\)l tracer and 1998 \(\mu\)l water.

Question 7

Concentration of Stock A \(= 0.050g/250 = 2 * 10^{-4} g/ml\)

Concentration of Stock B \(= 2*10^{-4}*1/100 = 2*10^{-6} g/ml\)

Final Concentration \(= 2*10^{-6}*0.25/250 = 2*10^{-6}*1/1000 = 2*10^{-9} g/ml\)

\[or\]

\[{{0.050}\over{250}}*{{1}\over{100}}*{{1}\over{1000}}=2x10^{-9} g/ml\]