BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
ycenycute
Obsidian | Level 7

I change class target to "linear regression" for the regression node. But then when I run the node, I get "Type 3 Analysis of Effects" in the results. I looked it up and found that type 3 analysis is for logistic regression, not for linear regression. May I know what is type 3 analysis and why do I get this in the linear regression instead of logistic regression?

1 ACCEPTED SOLUTION

Accepted Solutions
StatDave
SAS Super FREQ

This discussion is getting a bit confused. Maximum likelihood, least squares, GEE, and others are estimation methods for estimating the individual parameters of a specified model. Type 3 (as well as Types 1, 2, and 4) analyses are tests of specific hypotheses on linear combinations of the model parameters. This is discussed in detail (in the context of models estimated by least squares) in "The Four Types of Estimable Functions" chapter in the SAS/STAT User's Guide. However, you will also find some of these analyses in procedures that don't use least squares estimation, such as PROC GENMOD which can provide Type 1 and Type 3 analyses - see the Type 1 and Type 3 analysis subsections in the Details section of the GENMOD documentation. Type 3 analyses are commonly used as a way to assess the overall effect of a CLASS predictor in the model, over and above the presence of the other predictors in the model. Since a CLASS predictor has multiple individual parameters estimated by the model, each parameter is individually tested to see if it equals zero which makes it hard to know the overall effect of the predictor. The Type 3 test of the predictor provides a single test of the effect of the model. A Type 1 analysis is similar but tests the predictor's additional effect in a sequential way depending on its order in the model specification.

View solution in original post

15 REPLIES 15
sbxkoenk
SAS Super FREQ

Hello,

 

Of course you can get Type 3 Analysis of Effects (i.e. Type III sum of squares) with linear regression !

But I have to add the Type 3 Analysis of Effects table (SS3) is actually only useful when a predictor variable is used as a classification variable.

 

See below program that puts SS1 , SS2 , SS3 and SS4 in the results pane :

title 'Gasoline Mileage Experiment';
data mileage;
   input mph mpg @@;
   datalines;
20 15.4
30 20.2
40 25.7
50 26.2  50 26.6  50 27.4
55   .
60 24.8
;

ods graphics on;
proc glm data=mileage;
   model mpg=mph mph*mph / p clm SS1 SS2 SS3 SS4 ;
run;
QUIT;
ods graphics off;
/* end of program */

Remark that p-values in Parameter Estimates table equal the p-values in SS3-table.

 

"Type III" tests test for the significance of each explanatory variable, under the assumption that all other variables entered in the model equation are present.

 

If you want a lengthy explanation about Type I , Type II , Type III and Type IV,

then go here :

The Four Types of Estimable Functions

https://support.sas.com/documentation/onlinedoc/stat/930/introglmest.pdf

If you want a quicker read, search the internet (a plethora of hits).

 

Best,

Koen

PaigeMiller
Diamond | Level 26

@sbxkoenk wrote:

 

But I have to add the Type 3 Analysis of Effects table (SS3) is actually only useful when a predictor variable is used as a classification variable.

 


I would not agree with that statement. It is useful for both classification predictor variables and continuous predictor variables.

--
Paige Miller
sbxkoenk
SAS Super FREQ

You are absolutely right , @PaigeMiller .
I was out all day today and thought a few times : I'll have to correct that false statement of mine later.

But you have done it already 😊.
I had confused myself this morning but it's too long a story to explain.

Thanks,

Koen

PaigeMiller
Diamond | Level 26

@ycenycute wrote:

I change class target to "linear regression" for the regression node. But then when I run the node, I get "Type 3 Analysis of Effects" in the results. I looked it up and found that type 3 analysis is for logistic regression, not for linear regression. May I know what is type 3 analysis and why do I get this in the linear regression instead of logistic regression?


It is not true that Type III applies only for logistic regression. It applies to linear regression as well. It measures how much of the response variability is caused by changes in a predictor variable.

--
Paige Miller
ycenycute
Obsidian | Level 7
Then what's the difference between type 3 analysis and maximum likelihood estimation results given by SAS output?
PaigeMiller
Diamond | Level 26

Type III is a calculation of how much of the variability of the response variable is explained by the predictor variable. It has nothing to do with Maximum Likelihood, which is a method of estimating the regression coefficients (Least Squares is another method).

--
Paige Miller
ycenycute
Obsidian | Level 7
Ok. But what does it mean by explaining the variability of Y variable? Similar to R square, but applies to each X variable? How is the p value obtained from the type 3 analysis? Any readings would be useful. I find SAS output something not commonly used....
PaigeMiller
Diamond | Level 26

Type III is not an "analysis" or "analysis method" like least squares or maximum likelihood. It is simply a method of determining the sum of squares for a given predictor. The only Type III is sum of squares, that's it.

 

Yes, it is similar to an R-squared for an individual predictor, but not identical either. In the case of multiple X variables, the sum of the Type III sum of squares across all x-variables may not sum to the total sum of squares because of the multi-collinearity between the X variables.

 

P-values are not obtained from the Type III sum of squares. They are obtained from the regression coefficient estimate and the estimate of the standard error.


I don't have specific readings to provide, but just about any text-book will explain.

--
Paige Miller
ycenycute
Obsidian | Level 7

Thanks so much  for the explanation. This is helpful. Regarding this statement "They are obtained from the regression coefficient estimate and the estimate of the standard error.", so is it obtained from the regression coefficients the estimate of the standard error from the maximum likelihood estimation? SAS output MLE estimates for coefficients for linear regression. 

Are the p-value the same as in type 3 analysis and MLE results? I don't think so.....

PaigeMiller
Diamond | Level 26

@ycenycute wrote:

Thanks so much  for the explanation. This is helpful. Regarding this statement "They are obtained from the regression coefficient estimate and the estimate of the standard error.", so is it obtained from the regression coefficients the estimate of the standard error from the maximum likelihood estimation? SAS output MLE estimates for coefficients for linear regression. 


Standard error and regression coefficients are computed by either Maximum Likelihood or Least Squares, depending on which SAS PROC you are using.

 

Are the p-value the same as in type 3 analysis and MLE results? I don't think so.....

 

There is no such thing as Type 3 analysis. There is Type III sum of squares for each x-variable (which is computed after the regression is fit by either Maximum Likelihood or Least Squares). P-values are not determined by sum of squares for the x-variable.

--
Paige Miller
PaigeMiller
Diamond | Level 26

Adding:

 

Are the p-value the same as in type 3 analysis and MLE results? I don't think so.....

 

The question doesn't make sense, the Type 3 sum-of-squares does not have an associated p-value, and thus can't be compared to p-values from MLE. (Least squares and MLE will not necessarily produce the same p-value, but that is not what you asked).

--
Paige Miller
StatDave
SAS Super FREQ

This discussion is getting a bit confused. Maximum likelihood, least squares, GEE, and others are estimation methods for estimating the individual parameters of a specified model. Type 3 (as well as Types 1, 2, and 4) analyses are tests of specific hypotheses on linear combinations of the model parameters. This is discussed in detail (in the context of models estimated by least squares) in "The Four Types of Estimable Functions" chapter in the SAS/STAT User's Guide. However, you will also find some of these analyses in procedures that don't use least squares estimation, such as PROC GENMOD which can provide Type 1 and Type 3 analyses - see the Type 1 and Type 3 analysis subsections in the Details section of the GENMOD documentation. Type 3 analyses are commonly used as a way to assess the overall effect of a CLASS predictor in the model, over and above the presence of the other predictors in the model. Since a CLASS predictor has multiple individual parameters estimated by the model, each parameter is individually tested to see if it equals zero which makes it hard to know the overall effect of the predictor. The Type 3 test of the predictor provides a single test of the effect of the model. A Type 1 analysis is similar but tests the predictor's additional effect in a sequential way depending on its order in the model specification.

ycenycute
Obsidian | Level 7

This makes sense. Type 3 analysis seems to work with categorical / nominal X variable. So it does not give the estimate for each category under the X variable, like the MLE does, but to give one estimate for the whole X variable. 

ycenycute
Obsidian | Level 7

I asked this because SAS outputs p-value for X variable in Type 3 analysis. This p-value is not the same as that in the MLE results for each individual X variable. 

sas-innovate-2024.png

Available on demand!

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

 

Register now!

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.

Discussion stats
  • 15 replies
  • 3070 views
  • 10 likes
  • 4 in conversation