Biostats Lab 8

.docx

School

California State University, Los Angeles *

*We aren’t endorsed by this school

Course

3000

Subject

Statistics

Date

Feb 20, 2024

Type

docx

Pages

8

Uploaded by CommodoreSeal5397

Report
LAB ASSIGNMENT #8 1. > pupa = read.csv("PupaWghts.csv") > pupa Media sex wght 1 wheat female 2.83 2 wheat female 2.30 3 wheat female 2.51 4 wheat male 2.48 5 wheat male 2.25 6 wheat male 2.36 7 corn female 2.60 8 corn female 1.82 9 corn female 1.92 10 corn male 1.79 11 corn male 1.49 12 corn male 2.18 13 oat female 2.20 14 oat female 2.23 15 oat female 2.69 16 oat male 1.33 17 oat male 1.14 18 oat male 1.29
2. > pupan = aggregate(wght ~ media + sex, pupa, length) > pupan media sex wght 1 corn female 3 2 oat female 3 3 wheat female 3 4 corn male 3 5 oat male 3 6 wheat male 3 > pupam = aggregate(wght ~ media + sex, pupa, mean) > pupam media sex wght 1 corn female 2.113333 2 oat female 2.373333 3 wheat female 2.546667 4 corn male 1.820000 5 oat male 1.253333 6 wheat male 2.363333 > pupasd = aggregate(wght ~ media + sex, pupa, sd) > pupasd media sex wght 1 corn female 0.4244212 2 oat female 0.2746513 3 wheat female 0.2668957 4 corn male 0.3459769 5 oat male 0.1001665
6 wheat male 0.1150362 > pupase = pupasd$wght / sqrt(pupan$wght) > pupase [1] 0.24503968 0.15857000 0.15409232 0.19974984 0.05783117 [6] 0.06641620 > pupam$media=as.factor(pupam$media) > pupam$sex=as.factor(pupam$sex) 3. > pupammat = matrix(pupam$wght,ncol=2,byrow=FALSE) > pupammat [,1] [,2] [1,] 2.113333 1.820000 [2,] 2.373333 1.253333 [3,] 2.546667 2.363333 > colnames(pupammat)=levels(pupam$sex) > rownames(pupammat)=levels(pupam$media) > pupammat female male corn 2.113333 1.820000 oat 2.373333 1.253333 wheat 2.546667 2.363333 > clrs=c("red","blue","green") > barx=barplot(pupammat,beside=TRUE,ylim = c(0,5), col=clrs, + ylab="Mean of Weight (mg)") > arrows(array(barx), pupam$wght, array(barx),
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help