Question

In: Statistics and Probability

In R, compute the mean and standard deviation for at least three numerical data columns. You...

In R, compute the mean and standard deviation for at least three numerical data columns. You will need to use read.csv to read your data file into an R data frame. Post your code on GitHub, and post the means and standard deviations on your webpage.

Solutions

Expert Solution

SOl:

url <- "http://rstatistics.net/wp-content/uploads/2015/09/ozone.csv"  
ozonedt <- read.csv(url)
dim(ozonedt)
names(ozonedt)

there were 366 rows and 13 columns.

column names are:

[1] "Month" "Day_of_month" "Day_of_week" "ozone_reading"   
[5] "pressure_height" "Wind_speed" "Humidity" "Temperature_Sandburg"
[9] "Temperature_ElMonte" "Inversion_base_height" "Pressure_gradient" "Inversion_temperature"
[13] "Visibility"

To get mean and standard deviation for at least three numerical data columns

Rcode is

mean(ozonedt$Wind_speed,na.rm=TRUE)
mean(ozonedt$Humidity,na.rm=TRUE)
mean(ozonedt$Temperature_Sandburg,na.rm=TRUE)
sd(ozonedt$Wind_speed,na.rm=TRUE)
sd(ozonedt$Humidity,na.rm=TRUE)
sd(ozonedt$Temperature_Sandburg,na.rm=TRUE)

OUTPUT IS:

> dim(ozonedt)
[1] 366 13
> names(ozonedt)
[1] "Month" "Day_of_month" "Day_of_week" "ozone_reading"   
[5] "pressure_height" "Wind_speed" "Humidity" "Temperature_Sandburg"
[9] "Temperature_ElMonte" "Inversion_base_height" "Pressure_gradient" "Inversion_temperature"
[13] "Visibility"
> head(ozonedt)
Month Day_of_month Day_of_week ozone_reading pressure_height Wind_speed Humidity
1 1 1 4 3.01 5480 8 20
2 1 2 5 3.20 5660 6 NA
3 1 3 6 2.70 5710 4 28
4 1 4 7 5.18 5700 3 37
5 1 5 1 5.34 5760 3 51
6 1 6 2 5.77 5720 4 69
Temperature_Sandburg Temperature_ElMonte Inversion_base_height Pressure_gradient
1 NA NA 5000 -15
2 38 NA NA -14
3 40 NA 2693 -25
4 45 NA 590 -24
5 54 45.32 1450 25
6 35 49.64 1568 15
Inversion_temperature Visibility
1 30.56 200
2 NA 300
3 47.66 250
4 55.04 100
5 57.02 60
6 53.78 60
> mean(ozonedt$ozone_reading,na.rm=TRUE)
[1] 11.51934
> mean(ozonedt$Wind_speed,na.rm=TRUE)
[1] 4.868852
> mean(ozonedt$Humidity,na.rm=TRUE)
[1] 58.47578
> mean(ozonedt$Temperature_Sandburg,na.rm=TRUE)
[1] 61.91484
> sd(ozonedt$Wind_speed,na.rm=TRUE)
[1] 2.116928
> sd(ozonedt$Humidity,na.rm=TRUE)
[1] 19.75923
> sd(ozonedt$Temperature_Sandburg,na.rm=TRUE)
[1] 14.27653


Related Solutions

Compute the​ mean, range, and standard deviation for the data items in each of the three...
Compute the​ mean, range, and standard deviation for the data items in each of the three samples. Then describe one way in which the samples are alike and one way in which they are different. Sample​ A: 6​, 14​, 22​, 30​, 38​, 46​, 54   Mean ? Range ? Standard Deviation ? Sample​ B: 6​, 10​, 14​, 30​, 46​, 50​, 54 Mean ? Range ? Standard Deviation ? Sample​ C: 6​, 6​, 6​, 30​, 54​, 54​, 54 Mean ? Range ?...
In a certain​ distribution, the mean is 40 with a standard deviation of 5 At least...
In a certain​ distribution, the mean is 40 with a standard deviation of 5 At least what fraction of the numbers are between the following pair of​ numbers? 30 and 50
If x is a binomial random variable, compute the mean, the standard deviation, and the variance...
If x is a binomial random variable, compute the mean, the standard deviation, and the variance for each of the following cases: (a)  n=3,p=0.9 μ= σ^2= σ= (b)  n=6,p=0.1 μ= σ^2= σ= (c)  n=4,p=0.6 μ= σ^2= σ= (d)  n=5,p=0.8 μ= σ^2= σ=
If x is a binomial random variable, compute the mean, the standard deviation, and the variance...
If x is a binomial random variable, compute the mean, the standard deviation, and the variance for each of the following cases: (a)  n=4,p=0.4n=4,p=0.4 μ= σ2= σ= (b)  n=3,p=0.2n=3,p=0.2 μ= σ2= σ= (c)  n=3,p=0.6n=3,p=0.6 μ= σ2= σ= (d)  n=6,p=0.7n=6,p=0.7 μ= σ2= σ=
Suppose that IQ is normally distributed with mean of 100 and standard deviation of 10. Compute...
Suppose that IQ is normally distributed with mean of 100 and standard deviation of 10. Compute the following: What is the probability that a randomly selected individual has IQ greater than 115? (2 pts) What is the probability that a randomly selected individual has IQ between 90 and 100? (3 pts)
Use SPSS to compute the mean, standard deviation, variance, and range for the following sets of...
Use SPSS to compute the mean, standard deviation, variance, and range for the following sets of scores. Name the scores, Scores. a. 8, 2, 6, 12, 4, 7, 4, 10, 13, 15, 11, 12, 5 b. 7.2, 2.3, 5.4, 2.3, 3.4, 9.2, 7.6, 4.7, 2.8, 6.5 c. 23, 65, 47, 38, 86, 57, 32, 66, 43, 85, 29, 40, 42 d. 212, 334, 250, 436, 425, 531, 600, 487, 529, 234, 515 e. Does SPSS use N or N ⫺...
the mean of the data set: 37634.3 the standard deviation of the data set: 10967.85287 the...
the mean of the data set: 37634.3 the standard deviation of the data set: 10967.85287 the sample size of the data set: 50 Using the numbers above calculate the following Show your step-by-step work for each question: Determine the 90% confidence interval, assuming that sigma is unknown, list each in proper (lower bound, upper bound) notation. Make a confidence statement. Determine the 95% confidence interval, assuming that sigma is unknown, list each in proper (lower bound, upper bound) notation. Make...
1) From the data table given, compute the population standard deviation, ?. 2) From the data...
1) From the data table given, compute the population standard deviation, ?. 2) From the data table given, compute the Upper Control Limit for s (UCLs) 3) From the data table given, compute the centerline, Xbar-bar. 4) From the data table given, compute the Average of s values, sbar. 5)Calculate the Upper Control Limit, UCLXbar 6) From the data table given, compute the Lower Control Limit, LCLXbar This table was all the information given. I was wondering if I was...
Calculate the standard deviation of the following test data by hand. Describe the mean and standard...
Calculate the standard deviation of the following test data by hand. Describe the mean and standard deviation in words after calculating it. Record the steps. Test Scores: 40, 25,50, 30, 60, 80, 20, 70
For exercises 21-23, construct a probability distribution and compute the mean and standard deviation for only...
For exercises 21-23, construct a probability distribution and compute the mean and standard deviation for only 21 and 23. 21 Kathryn and John would like to rent a car for a day at the airport. There is a 0.30 probability that they will rent a truck at $20per day, a 0.27 probability that they will rent a SUV at $18 per day, and a 0.28 probability that they will rent a sport car at $35 per day, and a 0.15...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT