BookmarkSubscribeRSS Feed
acleamon
Calcite | Level 5

code is working as it says there is no errors however it capsize_micro is showing a parameter estimate of 0 

I am trying to compare return to market cap size - mega, large, mid, small, and micro

proc import datafile="/home/u63997444/ECON 348/Master use good 4.csv"
out=work.finaluse
dbms=csv
replace;
run;

data capsizedd;
set finaluse;

/* Assigning capsize based on Firm */
if 1 <= Firm <= 10 then capsize = "mega";
else if 11 <= Firm <= 20 then capsize = "larg";
else if 21 <= Firm <= 30 then capsize = "mid";
else if 31 <= Firm <= 40 then capsize = "smal";
else if 41 <= Firm <= 50 then capsize = "micr";
else capsize = "unknown"; /* Default case for capsize if Firm is not in expected range */

/* Convert capsize into numeric dummy variables for regression */
if capsize = "mega" then capsize_mega = 1; else capsize_mega = 0;
if capsize = "larg" then capsize_large = 1; else capsize_large = 0;
if capsize = "mid" then capsize_mid = 1; else capsize_mid = 0;
if capsize = "smal" then capsize_small = 1; else capsize_small = 0;
if capsize = "micr" then capsize_micro = 1; else capsize_micro = 0;
run;

proc reg data=capsizedd;
model return=capsize_mega capsize_large capsize_mid capsize_small capsize_micro;
run;

6 REPLIES 6
PaigeMiller
Diamond | Level 26

Show us what you are looking at that makes you say it isn't right. Explain what you expect to see that would be "right".

 

Next, no need to compute dummy 0/1 variables like you did, you can perform this regression in PROC GLM without creating dummy 0/1 variables.

 

proc glm data=capsizedd;
class capsize;
model return=capsize/solution;
run;

 

--
Paige Miller
acleamon
Calcite | Level 5

It's because capsize micro is showing a paramter estimate of 0 which doesn't make sense given other cap sizes have parameter estimates

PaigeMiller
Diamond | Level 26

That's how the math works and that's how SAS works, one of the categories will get an estimate of zero. And there's nothing wrong with this answer. I wrote an example to show why this is one way of handling this situation.

 

https://communities.sas.com/t5/Statistical-Procedures/Interpreting-Multivariate-Linear-Regression-wi...

 

From now on, @acleamon please give more explanation in your first post, do not assume we know what you know.

--
Paige Miller
acleamon
Calcite | Level 5
 
hollandnumerics
Lapis Lazuli | Level 10
Have you read the SAS log produced when you ran your program?
Was there anything interesting or useful there to tell you why it is not working?
Can you post a copy of the entire log here please?
Philip R Holland
Recent book (see my blog site): "SAS Programming Experiences: A How-To Guide from a Power SAS User"
hollandnumerics
Lapis Lazuli | Level 10

@acleamon ,

When I was learning SAS I was encouraged, no threatened, that if I hadn't read the SAS Log no-one would believe that my program had failed!! The reason is that the SAS Log often has THE answers to your questions about why your SAS program has died/crashed/failed, and I should read the SAS Log first to avoid being laughed it.

My experience, so don't make it yours too. Give us a look at your SAS Log!!

..........Phil

 

 

Philip R Holland
Recent book (see my blog site): "SAS Programming Experiences: A How-To Guide from a Power SAS User"

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 6 replies
  • 1969 views
  • 2 likes
  • 3 in conversation