{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}


AndersonB_Sec2_Lab2 - Biological Statistics I Biometry 3010...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Biological Statistics I Biometry 3010 / Natural Resources 3130 / Statistical Science 2200 Lab 2 Name: Beverly Anderson Section: 2 Date: 13 September 2010 In Lab 1 we became familiar with different ways of reading data into R, computing some standard statistics based on that data, and examining the distribution of the data using histograms. In Lab 2 we will learn how to access different elements of a data object, compute some more standard statistics, and explore different methods of visualizing the data. Import the Skull.txt dataset available on the lab website. After you import the dataset it should appear in the Object Explorer Window or in the command window if you type in ls(). The Skull data set provides the maximum breadth of samples of male Egyptian skulls from 4000 BC and 150 AD (based on data from Ancient Races of the Thebaid by Thomson and Randall-MacIver). Use the following command to make sure that the top line, the header, gets recognized as the column names and not just another line of data. Note that spaces (not commas this time) separate the data columns. Skull = read.tableheader=T) 1. (4 points) Access elements of a data object (all the following commands can be run from the R Console Command Window): a. What are the dimensions (number of rows, number of columns) of the Skull data object? > Skull = read.table("Skull.txt",header=T) > dim(Skull) [1] 24 2 The dimensions are 24 by 2 b. What data are contained in the first three elements of column 2, that is Breadth? > Skull$Breadth[1:3] [1] 131 119 138 > Skull[1:3,"Breadth"] [1] 131 119 138 > Skull[1:3,2] [1] 131 119 138 c. What is the mean head size (breadth) of males in 4000 BC? In 150 AD? > mean(Skull$Breadth[Skull$Era=="BC"]) [1] 128.6667 > mean(Skull$Breadth[Skull$Era=="AD"]) [1] 133.3333
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
d. Use the tapply() and summary() functions to examine the distribution of the data? > tapply(Skull$Breadth,Skull$Era,summary)
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page1 / 10

AndersonB_Sec2_Lab2 - Biological Statistics I Biometry 3010...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon bookmark
Ask a homework question - tutors are online