BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
sastuck
Pyrite | Level 9

You're saying it's better to create a new data set every step of the way? That's good advice, but doesn't that essentially mean revising my whole program?

Reeza
Super User

It's your choice to revise your program or not. This is advice to not program in this manner based on over a decade of experience, because its a good way to make mistakes and makes it much harder to find them. And if you ever need to re-run something you have to re-run your full program. 

 


@sastuck wrote:

You're saying it's better to create a new data set every step of the way? That's good advice, but doesn't that essentially mean revising my whole program?


 

ballardw
Super User

First thing:

Habitual use of the source data and out put with the same name replaces the orginal data set. Since you are modifying an existing variable then you may need to go further back in your process to recover the data.

 

When testing code use something like

data ceo_trial;
    set ceo_firm2;
    VOL=VOL/1000;
run;

to prevent accidents with the contents of your source data. Your description: "gives me a table with only the variable volume" sounds like this has already happened as the code you show would not do that. A Keep or drop statement would be more likely to have that result.

 

I would recommend creating new variable(s) to test your scaling on. That way you could have multiple variables in a set such as

Vol1000 = Vol/1000;

Volsq     =Vol*Vol;

Volrt       = sqrt(vol);

 

then in your regression you could use any one or combination of the new variables. And you would still have the original VOL to ensure that the resulting scale was the one you wanted.

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

Develop Code with SAS Studio

Get started using SAS Studio to write, run and debug your SAS programs.

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
  • 17 replies
  • 7302 views
  • 4 likes
  • 3 in conversation