?
Solved

SAS Programming - calculations on class Interval based data

Posted on 2006-03-31
4
Medium Priority
?
339 Views
Last Modified: 2010-04-17
Hi,

How do we input and run procedures
 on a class interval based data for example


Class Interval                             Frequency
    0-2                                              1
    3-5                                              3


etc. If I want to run proc Univariate on this to calculate basic stats
then how will I do that


thanks
-amit
0
Comment
Question by:anshuma
  • 2
  • 2
4 Comments
 
LVL 4

Expert Comment

by:tobydavid
ID: 16345136
First, I would create a variable which would indicated which interval you wanted

In your example

if classinterval < 3 then classind = 1; else
if classinterval < 6 then classind  = 2;    /* etc */

If you have a lot of these, I would recommend the SELECT statement

SELECT (Classinterval);

when (0..2) classind=1;
when (3..5) classind=2;
...
end;

Then run proc univariate with the classification variable indicated.

PROC UNIVARIATE; CLASS classind;
0
 

Author Comment

by:anshuma
ID: 16366896
I am sorry but I couldn't figure it out. Could please send me the code

This is the data

0-2      1
3-5      3
6-8      5
9-11      4
12-14      2


I tried creating the following code

data temp1;
set sasuser.EX3_29;
classind=_N_;

PROC UNIVARIATE DATA=temp1;
CLASS classind;

EX3_29 is the sasdata set with following properties

-----Alphabetic List of Variables and Attributes-----
# Variable Type Len Pos Label
1 Class_Interval Char 255 8 Class_Interval
2 Frequency Num 8 0 Frequency

thanks
-anshu
0
 
LVL 4

Accepted Solution

by:
tobydavid earned 2000 total points
ID: 16381318
I do not think that I understand the problem.  If your data only consists of class interval and frequency, what stats are you hoping to produce?

The thought the problem was that you had data on some measure like taxes, for example and you class interval was based on, say, income class and you wanted to know averages, totals, etc of tax by income class.

From your reply, its sounds like frequencies have already be calculated for your classes and you are not interested in any other variable, so I am not sure where you are going from here.

If I have a better understanding, I am confident that I can help.

-- tobydavid
0
 

Author Comment

by:anshuma
ID: 16442544
I am sorry for being so late. I hope that you won'd mind this. I will post the question soon albeit with more explaination.

sincerely
-anshu
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Make the most of your online learning experience.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
Simple Linear Regression

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question