BookmarkSubscribeRSS Feed
swimmer
Calcite | Level 5

Hi,

I use proc glm to run multiple regression model, I wonder if it is possible to display the categorical parameter level in format in the output. For example, I have the following output after proc glm,

where PROG has three levels, 1, 2, 3 with format as 1 = 'low', 2 = 'med', 3 = 'high'. Is it possible to display 'low', 'med', 'high' instead of 1, 2, 3 in the output? Thank you very much!

  Parameter Estimate Error t Value Pr > |t|

  Intercept 0.0510179965 B 0.18457670 0.28 0.7823

  PROG 1 -.4233591913 B 0.07772768 -5.45 <.0001

  PROG 2 -.1468757972 B 0.06539618 -2.25 0.0251

  PROG 3 0.0000000000 B . . .

2 REPLIES 2
Reeza
Super User

What does your code look like? Have you tried the standard class/format statements?

proc format;

value 1 = 'low'

          2 = 'med'

         3='high';

run;

proc glm data=have;

class prog;

model y=prog;

format prog prog_fmt.;

run;

PGStats
Opal | Level 21

The levels of PROG will be displayed as their formatted values if PROG is associated with a format, either in your dataset (permanent association) or during the glm procedure run (temporary association). For example

proc format;

value lmh

1 = 'low'

2 = 'med'

3 = 'high';

run;

proc glm data=myData;

format PROG lmh.;  /* Associate format with CLASS variable */

class PROG;

model y = PROG / solution;

run;

PG

PG

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 908 views
  • 0 likes
  • 3 in conversation