- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I have to use proc format to categorize a variable from my data set, the instructions are as follows:
If any student with High School Class Rank percentile less than 82 is categorized as hcrank and lcrank otherwise (use proc format to categorize).
My code:
proc format;
value hsrank 'hcrank' max= '82'
other = 'lcrank';
run;
/***/
data temp;
infile '/folders/myfolders/MY SAS Files/Data/finaldata.txt';
input ID gpa hsrank act year;
label ID = 'Identification'
gpa = 'Grade-point average following freshman year'
hsrank = 'High school class rank as percentile'
act = 'ACT entrence examination score'
year = 'Calender year that freshman entered university';
run;
followed by :
- Find the 99% confidence interval for the proportion of lcrank.
since I can not run the first part, I can also not run the second part.
For the second part should i address it as proc univariate ?
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
proc format;
value hsrank low-82='hcrank'
other = 'lcrank';
run;
For the second part, use PROC FREQ
Paige Miller
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
proc format;
value hsrank low-82='hcrank'
other = 'lcrank';
run;
For the second part, use PROC FREQ
Paige Miller
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi PaigeMiller,
I am still confused about proc freq.
I have tried :
proc freq data=final2;
tables hsrank;
format hsrack hcrank.;
run;
which gives the High school class rank as percentile
output:
but can still not find the 99% confidence interval for the proportion of lcrank.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
@ivethguzman wrote:
Hi PaigeMiller,
I am still confused about proc freq.
I have tried :
proc freq data=final2; tables hsrank; format hsrack hcrank.; run;
You don't have a format named hcrank. You have a format named hsrank (at least if you used the code I showed). You also don't have a variable named hsrack. So first you need to fix the spelling errors.
Next, there are many many many many useful options in PROC FREQ, the one you want is the BINOMIAL option of the TABLES statement. It would be a good idea for you to become familiar with them because I'm sure you will be using them a lot. Here they are: https://documentation.sas.com/?docsetId=statug&docsetTarget=statug_freq_syntax08.htm&docsetVersion=1...
Paige Miller