Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
jcruet_bi variate r regression
#X data x <- c(20, 16, 19.79999924, 18.39999962, 17.10000038, 15.5, 14.69999981, 17.10000038, 15.39999962, 16.20000076, 15, 17.20000076, 16, 17, 14.39999962) #Y data y <- c(88.59999847, 71.59999847, 93.30000305, 84.30000305, 80.59999847, 75.19999695, 69.69999695, 82, 69.40000153, 83.30000305, 79.59999847, 82.59999847, 80.59999847, 83.5, 76.30000305) #mean mean(x) #mean mean(y) #variance var(x) #variance var(y) #standard deviation sd(x) #standard deviation sd(y) #sum of sd x and y sum (sd(x+y)) #sum of squared deviation (sd(x)+sd(y)) #corelation of x and y cor(x,y) #covariance of x and y cov(x,y) #interpret correlation #My correlation is closer to positive 1, near perfect correlation. reg <- lm(y ~ x) summary(reg) # sqrt(sum(reg$residuals**2)/3) # reg$fitted.values # plot(density(reg$residuals)) # 1 - sum(reg$residuals**2) / sum((y-mean(y))^2) #Redisuals #My residual is.490 but residuals are supposed to add up to 0. #R^2 statistic, 70% of the variation is explained by the model. #Data point will fall 60% from the regression model. #The F statistic is 29 and the p value is closer to 0, therefore F statistic is sufficiently large and p value is small. #plot plot (x,y) #redline abline(lm(y~x), col="red")
run
|
edit
|
history
|
help
0
Good Ozone
21-09-2020IntpoliLagaproxf
Distribution stable under iteration
17-08-2020Ex2.1.1
Gab1A(resumido)
14-09-2020QRajustelinear
Assignment2 Q1
Prediction
Hello, world!
Chapter 4:Comparing Distributions (same scale)