+1-415-670-9189
info@expertsmind.com

# Get Solution

Explore airquality dataset available in the datasets library
Course:- Basic Statistics
Reference No.:- EM131146250

 Tweet

Expertsmind Rated 4.9 / 5 based on 47215 reviews.
Review Site
Assignment Help >> Basic Statistics

This assignment questions 1 - 4 make use of data that is provided by the ISwR package.

library(ISwR)

## Warning: package 'ISwR' was built under R version 3.2.5

Sample Question and Solution
Use seq() to create the vector (1, 2, 3, . . . , 10).

seq(1,10)

## [1] 1 2 3 4 5 6 7 8 9 10

Question 1

In this question you will explore the airquality dataset available in the datasets library in the ISwR package. a)Display the first 6 rows of the airquality dataset.

b) Display the type of each column of the airquality dataset, use only one function in R to do so.

c) Use a histogram to assess the normality of the Ozone variable.(In order to get the output diagram inserted in your answer use attach(dataframe name))

d) Does it appear normally distributed?

e) Create a boxplot which shows the distribution of Ozone in each month.Use different colors for each month.

f) Create one scatter plot matrix of the numeric variable(Ozone, Solar.R,Wind,Temp) within the airquality dataset. (Hint investigate pairs())

Question 2

a) Use simulation to estimate the mean and variance of a binomial random variable with n = 18 and p = 0.76.

b) Calculate the values using the theroy (state the value and the equation in your answer),compare the values you get with the values you got in (a), wirte one sentence sumurizing the comparision.

Question 3

a) Estimate the mean and variance of a Poisson random variable whose mean is 7.2 y simulating 10,000 Poisson random numbers.

b) Compare the mean value you got in (a),with the one stated in the question. wirte one sentence summarizing the comparision.

Question 4

Simulate 100 realizations of a normal random varialbe having a mean of 51 and a standard deviation of 5.2.

Question 5

This question makes use of pakcage "RCurl", accordingly carry out the following:

First we read the computers.csv file and load the price using the following:

a) Display the first 6 rows of cprices and make note of all the variables.

b) Calculate the mean,variance and standard diviation of price by omitting the missing values, if any.

c) Use ram to predict price and build a univariate linear regression model, display a summary of your model indicating Residuals, Coefficients..etc.

d) Based on the output of your model, predicted the expected price when ram is set to 8 MB

e) Find Pearson correlation between hard disk and speed.

f) Write the correlation matrix of the variables:price,speed,hd and ram.

Bonus Question

Π appears in the formula for the standard normal distribution, the most important probability distribution in statistics. Why not give it a try to calculate π using statistics! In fact, you'll use a simulation technique called the Monte Carlo Method.

Recall that the area of a circle of radius r is A = πr2. Therefore the area of a circle of radius 1, aka a unit circle, is π. You'll compute an approximation to the area of this circle using the Monte Carlo Method.

a) The Monte Carlo Method uses random numbers to simulate some process. Here the process is throwing darts at a square. Assume the darts are uniformly distributed over the square. Imagine a unit circle enclosed by a square whose sides are of length 2. Set an R variable area.square to be the area of a square whose sides are of length 2.

b) The points of the square can be given x-y coordinates. Let both x and y range from -1 to +1 so that the square is centred on the origin of the coordinate system. Throw some darts at the square by generating random numeric vectors x and y, each of length N = 10,000. Set R variables x and y each to be uniformly distributed random numbers in the range -1 to +1. (hint: runif() generates random number for the uniform distribution)

c) Now count how many darts landed inside the unit circle. Recall that a point is inside the unit circle when x2 + y2 < 1. Save the result of sucessfull hits in a variable named hit. (hint: a for loop over the length of x and y is one option to reach hit)

d) The probability that a dart hits inside the circle is proportional to the ratio of the area of the circle to the area of the square. Use this fact to calculate an approximation to Π and print the result.

Verified Expert

This task provides a clear working example of discrete and continuous distributions using R codes. The probability that a dart hits inside the circle is proportional to the ratio of the area of the circle to the area of the square. Use this fact to calculate an approximation to ? and print the result

View Conversion
Minimize
 inf1146250 4/25/2018 5:46:26 AM Thanks, this is the third paper that I have got done from expertsmind and like the first two asignments it is also same good quality. It is really wonderful job so thanks to the expert who did it. I just cant say enough about the work and explanation he did on my query. I am really thankful. Thank you so much, I will let you for my upcoming assignments soon. This is really helpful service for me.