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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 717 views
  • 3 likes
  • 3 in conversation