HW6%20Solutions

HW6%20Solutions - 0.2218070 3. Sample median, first...

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

View Full Document Right Arrow Icon
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)
Background image of page 1
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 &gt; 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 &gt; 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 &gt; IQR(amazon$Price) 45.53 Alternatively, ? = 64.5375 19.0075 = 45.53 . Sample range of the return: 1.2657 ( 0.4113) = 1.677 &gt; IQR(amazon$Return) 0.188675...
View Full Document

Ask a homework question - tutors are online