Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Research Methods I Final
# Ludy Thenor # John Jay College # Final Exam #BIVARIATE REGRESSION (Answers to Questions 9-16 Annotated Below) # Data Set 1 x <-c(8, 12.5, 15, 10) y <-c(2, 7, 8, 3) n <- length(x) mean(x) # 11.375 mean(y) # 5 b1 <- cov(x,y)/var(x) # estimated x1-coefficient (slope) b0 <- mean(y) - b1 * mean(x) # estimated y-intercept yhat <- b0 + b1 * (x) # predicted y value uhat <- y - yhat # residual b1 # 0.93905192 mean(y) - -5.681 * mean(x) # - 0.9391 b0 # -5.6817156 yhat # 1.83069976 6.0564334 8.40406334 3.7088036 uhat # .17 .94 -.40 -.71 ess <- sum((yhat - mean(y))^2) # expected sum of squares rss <- sum((y - yhat)^2) # residual sum of squares tss <- sum((y - mean(y))^2) # total sum of squares r2 <- (ess/tss) # correlation coefficient ser <- (sqrt(rss / (n-2))) # standard error fstat <- (ess / (rss / (n-2))) # F-statistic ess # 24.3966 rss # 1.5766 tss # 26 r2 # 0.93833077 ser # 0.88786260198 fstat # 30.81 lm(formula = y ~ x) summary(lm(formula = y ~ x))
run
|
edit
|
history
|
help
0
31-08-2020-Exemplo Ajuste
BoxPlot_Anomaly
Ex-02-02-21n
Practice
Gab1A(resumido)
EulerEx1
marian
factorial code
Data Transformation
Comparison between Normal and Laplace models for option pricing