Question

In: Math

The on-base percentage (OBP) indicates how successful a baseball player is as a batter. The dataset...

The on-base percentage (OBP) indicates how successful a baseball player is as a batter. The dataset OBP in UsringR contains the OBP for the year 2000. Test whether these data come from normal distribution.

Use R to solve and show R code

Solutions

Expert Solution

#Removing all the variables and libraries
rm(list=ls())

#Loading the required library UsingR
#You can install it using install.packages("UsingR")

library(UsingR)

# We will verify the normality using quantile plot and density plot.
# Loading the dataset

OBP[1:10]
youngdm01 velarra01 tynerja01 thompry01 selbybi01 riverru01 matosju01 maciajo01
0.3287037 0.3246753 0.2485876 0.2945205 0.2784091 0.3021978 0.2791878 0.2943548
maciajo01 lopezlu02
0.2905983 0.2321429


#Now convert the data in a usable format

df <- as.numeric(OBP)
df[1:20]
[1] 0.3287037 0.3246753 0.2485876 0.2945205 0.2784091 0.3021978 0.2791878
[8] 0.2943548 0.2905983 0.2321429 0.2616279 0.3198529 0.3254593 0.3561644
[15] 0.2958580 0.2388060 0.2846154 0.2916667 0.3643725 0.2800000

# Quantile Plot
# qqnorm()function will do this for us

qqnorm(df)

#Now use density plot

plot(density(df))

# We will also use shapiro.test() function to perform Shapiro-Wilk test
# Ho: Data is normal H1: Data is not normal
# If p-value<0.05 Reject null hypothesis otherwise fail to reject null hypothesis

shapiro.test(df)

Shapiro-Wilk normality test

data: df
W = 0.97092, p-value = 1.206e-07


# p-value = 1.206e-07 < 0.05, Hence reject the null hypothesis.
# Our data is not normally distributed
# You can also see in the density plot that it is positively skewed.
# Also in the quantile plot points are not distributed close to the diagonal line.
# Our data is not normally distributed.

*the bold text is output


Related Solutions

Create a base class that describes a baseball player. A baseball player’s attributes are: player name...
Create a base class that describes a baseball player. A baseball player’s attributes are: player name player number A pitcher has all the attributes of a baseball player but also has two other attributes: number of innings pitched number of earned runs. All pitchers have an earned run average which is calculated as : (Earned runs / innings pitched ) x 9 A batter has all of the attributes of a baseball player plus two other attributes: number of at...
10. Suppose that for a certain baseball season, winning percentage, y, and on-base percentage, x, are...
10. Suppose that for a certain baseball season, winning percentage, y, and on-base percentage, x, are linearly related by the least squares regression equation: ?̂ = 2.94? − 0.4875. For this baseball season, the lowest on-base percentage was 0.310 and the highest was 0.362. a. Underline the correct choice and fill in the blank in the following statement: As the on-base percentage increases by 5 percent, the predicted winning percentage increases / decreases by__________ b. Would it be a good...
A baseball player wants to know his average time running from home to first base. He...
A baseball player wants to know his average time running from home to first base. He records the following five times in seconds: 5.1 4.9 5.1 5.2 5.0 Construct a 95% confidence interval for the mean number of seconds it takes for this baseball player to run from home to first. Interpret this interval within the context of the problem.
A batter hits the baseball A with an initial velocity of v0 = 97 ft/sec directly...
A batter hits the baseball A with an initial velocity of v0 = 97 ft/sec directly toward fielder B at an angle of 40° to the horizontal; the initial position of the ball is 2.0 ft above ground level. Fielder B requires 0.23 sec to judge where the ball should be caught and begins moving to that position with constant speed. Because of great experience, fielder B chooses his running speed so that he arrives at the “catch position” simultaneously...
The baseball diamond at Grayson Stadium is a square with 90 ft sides. A batter hits...
The baseball diamond at Grayson Stadium is a square with 90 ft sides. A batter hits the ball and runs to the right toward first base with a constant speed of 24 ft/s. At the same time a runner on 3rd base runs home at a constant speed of 28 ft/s. At what rate is the distance between the two runners changing two seconds after they start running?
A baseball player at bat hits a ball to the outfield. The baseball is hit when...
A baseball player at bat hits a ball to the outfield. The baseball is hit when it is at a height of 1.60 m above the home plate. The ball’s velocity the instant it is hit is 34.00 m/s at an angle of exactly 54.00o above the horizontal. The ball lands safely in the outfield. Assume that the entire baseball ground is horizontal. (a) What are the vertical and horizontal components of the ball’s acceleration while it is in the...
A baseball player has a lifetime batting average of 0.168. If, in a season, this player...
A baseball player has a lifetime batting average of 0.168. If, in a season, this player has 460 "at bats", what is the probability he gets 101 or more hits? Probability of 101 or more hits = Answer is not .0015 or .0019.
Let x be a random variable that represents the percentage of successful free throws a professional basketball player makes in a season.
Let x be a random variable that represents the percentage of successful free throws a professional basketball player makes in a season. Let y be a random variable that represents the percentage of successful field goals a professional basketball player makes in a season. A random sample of n = 6 professional basketball players gave the following information. x676575867373 y424048514451 (a) Find Σx, Σy, Σx2, Σy2, Σxy, and r. (Round r to three decimal places.) Σx = Σy = Σx2...
HR Slugger is a professional baseball player in a Major League Baseball league. He is a...
HR Slugger is a professional baseball player in a Major League Baseball league. He is a well-known player and is very popular throughout the league, but especially with the local fans. Much of his population is based on his hitting ability, specifically regarding home runs. The issue emerges from the following facts, similar to an actual situation you may have heard of. • After days of intense anticipation by sports fans and winters throughout the league, Slugger hits a home...
during a baseball game, a batter hits a foul ball down the left field foul line....
during a baseball game, a batter hits a foul ball down the left field foul line. while being hit 0.762 m above the ground, the ball was given a velocity of 33.53 m/s at an angle of 55 degrees above the ground. 5 seconds after being hit, the ball was seen clearing a 11.28 m high wall in left field. a) what is the horizontal distance from home plate to the left wall? b) what is the vertical distance of...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT