×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Finding various means per group

Finding various means per group

Finding various means per group

(OP)
I have a fairly large data set that looks something like this:

Group    ID     Successes
1            1        3
1            2        10
1            3        4
2            1        3
2            2        8
2            3        2
3            1        9

And so on. But there are 1000 groups, and 50 IDs (so 50 observations in each group).

I need to do a couple of things that I've had difficulty figuring out.  One is I want to find a way to get the average number of success per group. One number. Right now everything I try gives me 1000 numbers. It'd also be helpful to see the min and max total successes.

I also need to be able to make a histogram or line plot of the total number of successes in each group plotted against the frequency with which they occur.

Seems like if I could take my data set and get one that looks like this:

Group   TotalSuccesses
1             17
2             13

And so on, this could be easier, but I haven't had any luck creating that set.

Tips?

RE: Finding various means per group

SAS has many was to do this type of thing. Here is an example using proc summary/means

CODE


data have ;
input Group    ID     Successes ;
cards ;
1            1        3
1            2        10
1            3        4
2            1        3
2            2        8
2            3        2
3            1        9
;;;

proc summary data=have nway ;
   class group ;
   var successes ;
   output out=want(drop=_:) sum= min=Min max=Max ;
   run;quit;
proc print;run;

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close