Turn on suggestions

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

Showing results for

- Home
- /
- Programming
- /
- Programming
- /
- Regression, How do I Enter Blocks of Variables?

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 04-05-2019 02:36 PM
(1375 views)

Hi Everyone,

I am trying to enter variables in blocks using SAS 9.4 in a way analogous to how SPSS does this. Here are the variables in this simplified example.

Dependent: Anxiety Test Score, "ANX"

Independent: Age, Gender, Education, Depression Measure score ("Depres"), Coping Measure score ("Cope").

What I'd like to do is regress "ANX" on "Depres" and"Cope," entered together as one "block" of variables," then in the same modelion, regress ANX on a second block of variables, "Age," "Gender," and "Education." In this way, I can tell if the relationship between "ANX" and the first variable block (psychological test scores) changes when I introduce the second block (demographic variables). I'm not really interested in doing stepwise regression (i.e., forward or backward selection), just this fairly simple analysis.

All I can tell from the documentation is that perhaps I indicate blocks by putting parentheses around the blocks of variables, but I'm not really sure if this is correct. Could anyone help me with this simple, I think, ,problem? This following states the problem in (sort of) SAS language.

**proc reg data=Cohort.Anxiety; model Anx = (enter first block of variables); (enter second block of variables); run;**

Thank you very much!

- Tags:
- beginner
- regression

1 ACCEPTED SOLUTION

Accepted Solutions

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

There's no parenthesis around the "blocks" in SAS PROC REG.

Just enter the variable names in one block, run the model, then fit another model with the variables from two blocks, and compare. One way to compare the models is the "Extra Sum of Squares Principle".

--

Paige Miller

Paige Miller

2 REPLIES 2

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

There's no parenthesis around the "blocks" in SAS PROC REG.

Just enter the variable names in one block, run the model, then fit another model with the variables from two blocks, and compare. One way to compare the models is the "Extra Sum of Squares Principle".

--

Paige Miller

Paige Miller

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

Thank you very much for your solution! Very appreciated!

Are you ready for the spotlight? We're accepting content ideas for **SAS Innovate 2025** to be held May 6-9 in Orlando, FL. The call is **open **until September 16. Read more here about **why** you should contribute and **what is in it** for you!

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.