HW6%20Solutions

# HW6%20Solutions - 0.2218070 3 Sample median first quartile...

This preview shows page 1. Sign up to view the full content.

AD Number________ Name_________________________ Score________ IE 300 / GE 331 HW6 Amazon_Monthly.txt contains monthly prices and returns of Amazon’s stock. Use R to compute the following. Copy and paste your R commands and outputs to this word file, and identify the required quantities. Solutions without such copied and pasted R commands and outputs are not accepted. 1. Sample mean price and return > amazon <- read.table("Amazon_Monthly.txt", header=T) > mean(amazon) Date Price Return NA 45.31525974 0.05025325 or > mean(amazon\$Price) 45.31526 > mean(amazon\$Return) 0.05025325 2. Sample standard deviation of the price and return > sd(amazon\$Price) 29.81394 > sd(amazon\$Return)
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 0.2218070 3. Sample median, first quartile and third quartile of the price and return > quantile(amazon\$Price) 0% 25% 50% 75% 100% 1.5400 19.0075 40.1000 64.5375 135.9100 first quartile= 19.0075 Sample median= 40.1000 third quartile= 64.5375 > quantile(amazon\$Return) 0% 25% 50% 75% 100% -0.411300 -0.055350 0.025900 0.133325 1.265700 first quartile= -0.055350 Sample median= 0.025900 third quartile= 0.133325 4. Sample range and IQR of the price and return Sample range of the price: 135.91 − 1.54 = 134.37 > IQR(amazon\$Price) 45.53 Alternatively, ?±² = 64.5375 − 19.0075 = 45.53 . Sample range of the return: 1.2657 − ( − 0.4113) = 1.677 > IQR(amazon\$Return) 0.188675...
View Full Document

## This note was uploaded on 05/04/2010 for the course GE 331 taught by Professor Negarkayavash during the Spring '09 term at University of Illinois at Urbana–Champaign.

Ask a homework question - tutors are online