- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi there,
I'm interested in understanding the amount of variance from each variable in a multiple linear regression analysis. I am using PROC GLM because I have a dummy categorical variable. What function allows me to do this? Or alternatively would I be able to use PROC REG to do this?
Thank you for your help!
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I guess you are looking for something like:
proc glm data=sashelp.class;
class sex;
model weight = sex|height / ss3;
ods output modelanova=ma overallanova=oa;
run;
proc sql;
select
ma.Dependent,
ma.source,
ma.SS / oa.SS as type3_PartialRsquare format=percentn7.1,
ma.probF
from
ma, oa
where oa.source="Corrected Total";
quit;
type3_ Partial Dependent Source Rsquare Pr > F ----------------------------------------------------- Weight Sex 0.2% 0.7360 Weight Height 60.6% <.0001 Weight Height*Sex 0.3% 0.6657
use with caution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
@xshinbrot0 wrote:
Hi there,
I'm interested in understanding the amount of variance from each variable in a multiple linear regression analysis. I am using PROC GLM because I have a dummy categorical variable. What function allows me to do this? Or alternatively would I be able to use PROC REG to do this?
Thank you for your help!
"Variance from each variable" isn't worded in a way that makes sense to me.
There is a variance of the slope estimate for each variable.
There is a percent of total variability explained by each variable (although this isn't a unique quantity unless you have a perfectly orthogonal set of input variables).
Is either of these what you are interested in? (Both of these, by the way, can be computed for categorical variables)
Also, with regard to your title (which really ought to be explicitly stated somewhere in the text of your message), there are partial correlations that can be computed in SAS, but as far as I am aware, there are no partial R-squared.
Paige Miller
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Apologies. I believe what I'm asking for is the coefficient of partial determination. When you conduct a multiple regression using forward, backward or stepwise, the output provides a partial R2 (along with a model R2), I'm interested in generating that from the PROC REG or PROC GLM statement with only the variables of interest.
Let me know if more clarification is needed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Ah, I see. I'm sorry to state that I have such negative opinions about stepwise regression that I completely block it out of my mind, and so I can't even help here as I don't know (or understand) what the statistic is in the context of stepwise regression.
Adding: my brain is so used to the underlying concepts of Partial Least Squares regression that the idea of assigning some (partial) R2 to individual variables is something that I would advise against (except in the case of a perfectly orthogonal X matrix).
Paige Miller
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
If I were interested in the variance of the slope estimate for each variable and the percent of total variability explained by each variable, where would I look in the output or is there a separate ODS statement I would need to add?
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
In PROC GLM, the variability of the slope estimate is, expessed as a standard error, in the "Standard Error" column, for example:
At the same link, the percent of total variability explained is shown under Mean Square (which is in variance units, not standard deviation units) but as I said, these values are not unique unless you have a perfectly orthogonal X-matrix, which you probably don't have.
Paige Miller
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I guess you are looking for something like:
proc glm data=sashelp.class;
class sex;
model weight = sex|height / ss3;
ods output modelanova=ma overallanova=oa;
run;
proc sql;
select
ma.Dependent,
ma.source,
ma.SS / oa.SS as type3_PartialRsquare format=percentn7.1,
ma.probF
from
ma, oa
where oa.source="Corrected Total";
quit;
type3_ Partial Dependent Source Rsquare Pr > F ----------------------------------------------------- Weight Sex 0.2% 0.7360 Weight Height 60.6% <.0001 Weight Height*Sex 0.3% 0.6657
use with caution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi there,
So I conducted the test as suggested, but it gives me the output with the partial R2 twice (see attached), why is that?
proc sql;
select
ma.Dependent,
ma.source,
ma.SS / oa.SS as type3_PartialRsquare format=percentn7.1,
ma.probF
from
ma, oa
where oa.source="Corrected Total";
quit;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
You should show the code for the regression.
Caution: consider @PaigeMiller's answers above and search Google for caution "r square"