I gave a link to an example using PROC GLMMOD which produces the desired output data set.
Thanks for your kind reply. However, proc glmmod procedure stops the SAS program several times. Is there any easy way to convert the character variable below to dummy variables in the current sas dataset? Thanks.
16 | 0.11 | 16 | 0.11 |
2 | 0.01 | 18 | 0.13 |
1 | 0.01 | 19 | 0.14 |
2 | 0.01 | 21 | 0.15 |
The easiest way is PROC GLM MOD. Show us the ENTIRE log for the PROC GLM MOD step.
When I run the following program, the whole SAS program stops without saving.
ods output out=m21;
proc glmmod data=m20;
model ln_audit = sdd1 sstmat leverage sodebt cspec ln_nonaudit icw restatement gc auchange merger financing yearend
ln_at mb big4 roa loss fsalepro sq_segs ar_in special_item ln_tenure y2000-y2016 dummy_sic2; run;
Thanks
Joon1
I don't see this command (copied exactly from the example)
ods output DesignPoints = DesignMatrix;
Also, from now on, we request that when you need to show us the code you are using, please click on the "little running man" icon and paste your code into the window that appears.
Thanks, PaigeMiller.
When I run the following program, the whole SAS program still stops without running and saving.
ods output DesignPoints = DesignMatrix;
proc glmmod data=m20;
class dummy_sic2;
model ln_audit = sdd1 sstmat leverage sodebt cspec ln_nonaudit icw restatement gc auchange merger financing yearend
ln_at mb big4 roa loss fsalepro sq_segs ar_in special_item ln_tenure y2000-y2016 dummy_sic2; run;
Thanks
joon1
Thanks
Joon1
@joon1 wrote:
Thanks, PaigeMiller.
When I run the following program, the whole SAS program still stops without running and saving.
I don't know what this means. Explain further. Provide details.
I asked you to show us the log earlier, and this didn't happen. So I ask again. Show us the LOG from when you run the code. This includes the entire LOG for PROC GLMMOD, in other words the code for PROC GLMMOD as seen in the LOG, plus all NOTEs, WARNINGs and ERRORs with PROC GLMMOD, with nothing chopped out, everything. Paste the log into the window that appears when you click on the </> icon. DO NOT SKIP THIS STEP.
I see the message above "SAS (Not Responding)" in the sas window. The code I presented is not working for whatever reason.
Unless your data set has hundreds of millions of records, I can't think of a reason why this code would cause SAS would go into not responding mode. How many records are in the data set?
Did you try re-starting SAS?
The number of observations are 30,000-40,000. I tried several times, but I face similar situations.
Is there any way to create industry dummy variables instead of "ind#" variables below?
length dummy_sic2 $ 10;
dummy_sic2=cats('ind#',put(sic2,z2.));
Thanks
Joon1
Well, I am stumped, and there's something wrong here. This code (using a smaller data set) runs almost instantly, doesn't cause a freeze. Even with your data set of 40,000 records, similar code ought to run quickly (although not instantly) and I can't understand why your SAS freezes.
ods output DesignPoints = DesignMatrix;
proc glmmod data=sashelp.cars;
class make;
model msrp = make invoice enginesize cylinders horsepower mpg_city mpg_highway weight wheelbase length;
run;
Why do you need the ind# in your dummy_sic2 values, anyway? Although that shouldn't make a difference, what happens if you use
dummy_sic2=put(sic2,z2.);
Anyway, here is another way to generate dummy variables: https://blogs.sas.com/content/iml/2020/08/31/best-generate-dummy-variables-sas.html
Thank you for your kind response. My SAS window freezes with glmmod procedure. Thank you for your valuable time. Have a good day and stay safe.
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.
Ready to level-up your skills? Choose your own adventure.