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


Hello Everyone,

I have a set of firms which I divided into three categories- 1, 2, and 3- based on their special characteristics. For each category, I have some information like sales, profit, and so on. I want to test the difference in proportion for this sample. In other words, I want to test whether the total sales in Group 1 is significantly different from Group 2 and 3. The data I have is as follows:

Group sales profit

1          100     20

2          150     10

3          120     40

I would appreciate if someone shares the code that will help me do the desired analysis.

Thank you.

1 ACCEPTED SOLUTION

Accepted Solutions
Ksharp
Super User

Are you calling some statistical method ?

If you want multi-comparion , Check out proc glm + lsmeans .

Note: these all is based on Normal Data.

Ksharp

View solution in original post

2 REPLIES 2
Ksharp
Super User

Are you calling some statistical method ?

If you want multi-comparion , Check out proc glm + lsmeans .

Note: these all is based on Normal Data.

Ksharp

SteveDenham
Jade | Level 19

It looks like you have removed all the variability in each group by summing within the group.  With only three groups and no replication within group, an analysis of variance approach (say PROC GLM) will not work, as there are no degrees of freedom left for error--they are all used up in the numerator.

Rather than summing, what about just classifying the individual firms into groups?  Working backwards from your summary data, what if you had something like:

data one;

input firmid firmclass sales profit;

datalines;

1 1 30 10

2 1 50 30

3 1 20 -20

4 2 60 0

5 2 90 10

6 3 50 10

7 3 40 20

8 3 30 10

;

proc glm data=one;

class firmclass;

model sales profit=firmclass;

lsmeans firmclass/pdiff stderr cl;

quit;

run;

This would implement Ksharp's suggestion, and provide tests about the marginal means of sales and profits.  Unfortunately, if you are truly interested in testing for differences in the totals of these variables, you need to have some sort of replication that is not readily apparent in your summary dataset.

Steve Denham

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

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 1281 views
  • 3 likes
  • 3 in conversation