DS4PS / cpp-523-fall-2019

Course shell for CPP 523 Foundations of Program Evaluation I for Fall 2019.
http://ds4ps.org/cpp-523-fall-2019/
6 stars 3 forks source link

Lab 1 #1

Open jmacost5 opened 5 years ago

jmacost5 commented 5 years ago

I am wanting to make sure that I understand to over all concept right for the lab. I was mainly using the numbers from the worksheet and I just want to see if I am getting the concepts right. Also should I complete the table or no?

lecy commented 5 years ago

Be careful with your formula for the slope. I think you are using the wrong variance.

Yes, question 5 asks for you to complete the table. The main thing to note is the residual (e) is calculated from Y - Yhat.

jmacost5 commented 5 years ago

I think I fixed the mistake I was making and actually did the table.

lecy commented 5 years ago

Your predicted Y column is off by a bit.

Your Sum of Square Errors should equal the Residual Sum of Squares in the table, and the Regression Sum of Squares should equal the X Sum of Squares (Explained SS) in the table.

It's ok to post code and specific questions, but I'm going to delete the screen shot of your full lab in case others have not yet finished (these boards are public).

jmacost5 commented 5 years ago

I guess I am confused on how to get the predicted value then. I assumed I would use the equation image and then I would put the x values in where the x goes, put the slope I calculated in, and the b0 value in and then it would give me the predicted y values.

lecy commented 5 years ago

Yep, just check your math. For example:

b0 <- -0.6
b1 <- 1.1
x_1 <- 2
x_2 <- 4
b0 + b1*x_1
b0 + b1*x_2
jmacost5 commented 5 years ago

I don't know what I am doing wrong I still got 1.6 and 3.8

jmacost5 commented 5 years ago

never mind I found my error. sorry for being a bug.