Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Home
- /
- Analytics
- /
- Stat Procs
- /
- finding point and perameter estimate using proc ttest

Options

- RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

🔒 This topic is **solved** and **locked**.
Need further help from the community? Please
sign in and ask a **new** question.

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Posted 03-24-2022 03:09 PM
(2159 views)

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

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

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

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

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

Paige Miller

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

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?

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

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;
```

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

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

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

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

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

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

*> 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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

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.

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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

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;
```

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

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

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

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

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.

**Available on demand!**

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.