BookmarkSubscribeRSS Feed
khalillx
Fluorite | Level 6

In my simulation exercise I have to change the error term in my code from 

data samples;
do samp = 1 to 1000;
do t = 1 to 100;
u = rannor(1996)*5;
x = 100 + 3*rannor(6991);
y = 10 + 0.5*x + u;
output;
end;
end;
run;

 

to 

 

data samples;
do samp = 1 to 1000;
do t = 1 to 100;
u = 3 + rannor(1996)*5;
x = 100 + 3*rannor(6991);
y = 10 + 0.5*x + u;
output;
end;
end;
run;

 

Then I'm supposed to comment on the changes to the mean and variance of B1hat and B0hat. But the only thing that changed was the intercept's mean increased by 3. Not sure why. I thought a lot would change if I made the error code have a mean of 3 instead of a mean of zero. Am I doing something wrong with the code? The shape of the histogram for both B1hat and B0hat are still symmetric as well. I'm super confused.

2 REPLIES 2
PaigeMiller
Diamond | Level 26

You don't state that you are performing linear regression (are you?), but if you are, then the mean of the residuals is always zero. This is just plain old algebra, and there's no way to get any other mean of the residuals.

--
Paige Miller

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 409 views
  • 0 likes
  • 3 in conversation