Quartz | Level 8

## finding point and perameter estimate using proc ttest

Consider the following simple linear regression model:

PRICE = β0 +β1 POOL +ε

In the data set, verify that POOL is 1 if a house has a swimming pool, 0 otherwise. Using the proc ttest output, complete the table below.  Use only the proc ttest output.

So I was trained to use proc reg on a question like this but was asked to use proc t-test. I think this should be my code since "1" means there is a pool and "0" means there isn't a pool

`proc ttest data=sarah.homeprices;var price;class pool;run;`

The problem is that when I run a proc ttest I don't see the model parameter or point estimate like proc reg

1 ACCEPTED SOLUTION

Accepted Solutions
SAS Super FREQ

## Re: finding point and perameter estimate using proc ttest

Yes. Most estimates are "point estimates" with the exception of confidence intervals, which we call "interval estimates."

The equivalent regression code is not PROC REG because PROC REG does not support a CLASS statement. The equivalent regression procedure is PROC GLM. Compare your TTEST output to the output of this call to PROC GLM:

``````proc GLM data=sarah.homeprices plots=none;
class pool;
model price = pool / solution;
quit;``````
11 REPLIES 11
Diamond | Level 26

## Re: finding point and perameter estimate using proc ttest

When POOL=1, the mean is 163050. When POOL=0, the mean is 169672. Therefore, the difference is –6622. This would be the point estimate. From there, you can read the confidence interval from the table, making sure to change the sign.

--
Paige Miller
Quartz | Level 8

## Re: finding point and perameter estimate using proc ttest

So I was able to run a proc reg to get my answer for the perameter estimate to be -6622 but was wondering how the -6622 came to be. Thank you for explaining that! Is the perameter estimate the same as point estimate?
SAS Super FREQ

## Re: finding point and perameter estimate using proc ttest

Yes. Most estimates are "point estimates" with the exception of confidence intervals, which we call "interval estimates."

The equivalent regression code is not PROC REG because PROC REG does not support a CLASS statement. The equivalent regression procedure is PROC GLM. Compare your TTEST output to the output of this call to PROC GLM:

``````proc GLM data=sarah.homeprices plots=none;
class pool;
model price = pool / solution;
quit;``````
Quartz | Level 8

## Re: finding point and perameter estimate using proc ttest

So PRICE = β0 +β1 POOL +β2(SIZE −2200)+ε the code would have to use proc reg instead of proc glm?
SAS Super FREQ

## Re: finding point and perameter estimate using proc ttest

Neither procedure has syntax for the term β2(SIZE −2200). You would need to create a new variable (SIZE22 = SIZE - 2200) and then use that variable in the model.

In general, PROC GLM can fit all the linear models that PROC REG fits. GLM is more useful when you have classification variables that contain more than two levels or when you have character variables.

Quartz | Level 8

## Re: finding point and perameter estimate using proc ttest

data newprices;
set sarah.homeprices;
size2200 = (size - 2200);
run;

proc reg data=newprices;
model price = size2200 pool;
run;

for some reason its making a new dataset with just the variable size2200
SAS Super FREQ

## Re: finding point and perameter estimate using proc ttest

> for some reason its making a new dataset with just the variable size2200

??? The NEWPRICES data set should contain all the original variables, plus the new SIZE2200 variable.

Quartz | Level 8

## Re: finding point and perameter estimate using proc ttest

Thats exactly my confusion. I'm trying to post what I get when I run the following code:
data newprices;
set sarah.homeprices;
size2200 = (size - 2200);
run;
For some reason the screenshot won't paste but its basically a blank table. I ran my libname again and it still the same.
SAS Super FREQ

## Re: finding point and perameter estimate using proc ttest

Run
PROC CONTENTS data=sarah.homeprices; run;

Is it possible that you accidentally overwrote sarah.homeprices?  Sometimes novices try to modify a data set in place like this:

``````/* DON'T DO THIS. A MISTAKE CAN DELETE THE DATA */
data sarah.homeprices;
set sarah.homeprices;
/* more lines go here....
but an ERROR muight result in overwriting the data with 0 obs */
run;``````
Quartz | Level 8

## Re: finding point and perameter estimate using proc ttest

I was able to obtain my point estimate and parameter model value using the following code you guided me through however, I was wondering if I can obtain the CI 95% intervals by manipulating this code?
data newprices;
set sarah.homeprices;
size2200 = (size - 2200);
run;

proc reg data=newprices;
model price = size2200 pool;
run;

I tried running a proc ttest but it would not let me use my new variable 'size2200' since it has two levels
SAS Super FREQ

## Re: finding point and perameter estimate using proc ttest

95% confidence limits for what? The regression coefficients? You can use

model price = size2200 pool / CLB;

The documentation for PROC REG discusses other options that produce different confidence intervals. Please read about the options on the MODEL statement.

Discussion stats
• 11 replies
• 2160 views
• 4 likes
• 3 in conversation