imgage <- "C:/Users/jpsim/Documents/Stat & Probability for Data/starbucks.png"
include_graphics(imgage)
There is positive linear relationship between calorie and carbohydrates.
x - axis is Calorie which is explanatory variable
y-axis is Carbohydrate which is response variable.
We would like to predict the amount of carbs based on calorie count.
The data fit a linear plot, residuals appear nearly normal. we cannot achieve constant variability.
imgage <- "C:/Users/jpsim/Documents/Stat & Probability for Data/body.png"
include_graphics(imgage)
data(bdims)
par(mar = c(3.8, 3.8, 0.5, 0.5), las = 1, mgp = c(2.7, 0.7, 0),
cex.lab = 1.25, cex.axis = 1.25)
plot(bdims$hgt ~ bdims$sho.gi,
xlab = "Shoulder girth (cm)", ylab = "Height (cm)",
pch = 19, col = COL[1,2])
Describe the relationship between shoulder girth and height. This relationship shows that the larger ones shoulder girth the taller one might be.
How would the relationship change if shoulder girth was measured in inches while the units of height remained in centimeters?
This relationship would remain the same.
Exercise above introduces data on shoulder girth and height of a group of individuals. The mean shoulder girth is 107.20 cm with a standard deviation of 10.37 cm. The mean height is 171.14 cm with a standard deviation of 9.41 cm. The correlation between height and shoulder girth is 0.67.
\(\hat{y} = 105.8445 + 0.6091 * `shouldergirth`\)
For additional cm of shoulder girth, there would be additional .6091 of height.We would expect a height of .6091 , If the shoulder girth of person is Zero.
B1=round(0.67 * (9.41/10.35),4)
B0=round(B1 * -107.20 + 171.14 , 4)
R=0.67
R2=R*R
R2
## [1] 0.4489
R100=B0 + B1 * 100
R100
## [1] 166.7545
Res=160 - 166.7545
Res
## [1] -6.7545
Model Overestimated the height of the individual.
This can be achieved only through Extrapolation. We are making an assumption that we can achieve linear relationship in uncharted data
imgage <- "C:/Users/jpsim/Documents/Stat & Probability for Data/cats.png"
include_graphics(imgage)
\(\hat{y} = -0.357 + 4.034 * `bodyweight`\)
If cat’s body weight is zero, we will expect the heart to weight -0.357 grams
For each additional kg of body weight, we can expect cat’s heaert to weigh additional 4.034 grams
\(R2 = 64.66%\), which means 64.66% of observed data can be explained using the linear model in a
B0=-0.357
B1=4.034
R2=.6466
corcof = sqrt(R2)
corcof
## [1] 0.8041144
imgage <- "C:/Users/jpsim/Documents/Stat & Probability for Data/ratep.png"
include_graphics(imgage)
B0=4.010
B1=4.13 * 0.0322
B1
## [1] 0.132986
On looking at scatter plot we can just see Scaters. There is no any upward or downward trend. p is shown as zero in summary table. It can be read as accepting the null hypothesis; there is no relation between teaching evaluation and beauty.
imgage <- "C:/Users/jpsim/Documents/Stat & Probability for Data/ratepc.png"
include_graphics(imgage)
imgage <- "C:/Users/jpsim/Documents/Stat & Probability for Data/ratepca.png"
include_graphics(imgage)
Visual inspection of scatterplot suggest residuals are randomly scattered around horizontal axis. Therefore, linearity is achieved.
Histogram skewed to the left, resulting in the possibility of some outliers.
Residuals are normal.
In the scatterplot, the points has constant variance.
These are independant observations, and shows a minor linear trends.