10-26-2022
Child79
Fluorite | Level 6
Member since
04-25-2022
- 8 Posts
- 3 Likes Given
- 0 Solutions
- 0 Likes Received
-
Latest posts by Child79
Subject Views Posted 711 10-13-2022 04:36 PM 450 10-12-2022 12:20 AM 536 10-07-2022 08:30 PM 810 10-03-2022 11:44 AM 815 10-03-2022 11:41 AM 894 10-01-2022 06:11 PM 655 04-27-2022 01:31 PM 736 04-25-2022 01:40 PM -
Activity Feed for Child79
- Liked Re: How to plot evolution curve of a numeric variable according to a categorical variable for Reeza. 10-15-2022 12:31 PM
- Liked Re: How to plot evolution curve of a numeric variable according to a categorical variable for ballardw. 10-15-2022 12:31 PM
- Posted How to plot evolution curve of a numeric variable according to a categorical variable on New SAS User. 10-13-2022 04:36 PM
- Posted Re: how to display the modalities of a categorical in a wanted order in proc tabulate or proc glplot on SAS Programming. 10-12-2022 12:20 AM
- Posted how to display the modalities of a categorical in a wanted order in proc tabulate or proc glplot ? on SAS Programming. 10-07-2022 08:30 PM
- Posted Re: Subtotals in rows and columns in proc tabulate SAS on SAS Programming. 10-03-2022 11:44 AM
- Liked Re: Subtotals in rows and columns in proc tabulate SAS for ballardw. 10-03-2022 11:42 AM
- Posted Re: Subtotals in rows and columns in proc tabulate SAS on SAS Programming. 10-03-2022 11:41 AM
- Posted Subtotals in rows and columns in proc tabulate SAS on SAS Programming. 10-01-2022 06:11 PM
- Posted Re: How to calculate the proportion of a modality of a binary variable in proc tabulate? on SAS Programming. 04-27-2022 01:31 PM
- Posted How to calculate the proportion of a modality of a binary variable in proc tabulate? on SAS Programming. 04-25-2022 01:40 PM
-
Posts I Liked
Subject Likes Author Latest Post 1 1 2
10-13-2022
04:36 PM
Hello, Here is my dataset. I have two categorical variables (type_college and name) and a numeric variable (COL1). I don't know how to plot on the same graph the evolution curves of COL1 according to name for each type_college. data students;
infile datalines dlm=',' dsd;
informat type_college $15. name $15. ;
input type_college name $ COL1 ;
datalines;
College private,delai_dec20,1.5
College private,delai_juin21,3.6
College private,delai_dec21,4.4
College private,delai_sep22,47.6
College public,delai_dec20,5.3
College public,delai_juin21,6
College public,delai_dec21,14.4
College public,delai_sep22,14.4
University,delai_dec20,11.1
University,delai_juin21,14.3
University,delai_dec21,14
University,delai_sep22,17.1
,delai_dec20,5.6
,delai_juin21,7.1
,delai_dec21,12
,delai_sep22,18.1
; here is exactly what I want for result. Thanks.
... View more
10-12-2022
12:20 AM
Sorry for errors. I wanted to use a small dummy dataset to represent the database I'm working with. I did not expect a value of "University private". It should just be "University". Thanks for correcting me. This is the good dataset. data students;
infile datalines dlm=',' dsd;
informat type_college $15. name $15. ;
input type_college name $ COL1 ;
datalines;
College private,delai_dec20,1.5
College private,delai_juin21,3.6
College private,delai_dec21,4.4
College private,delai_sep22,47.6
College public,delai_dec20,5.3
College public,delai_juin21,6
College public,delai_dec21,14.4
College public,delai_sep22,14.4
University,delai_dec20,11.1
University,delai_juin21,14.3
University,delai_dec21,14
University,delai_sep22,17.1
,delai_dec20,5.6
,delai_juin21,7.1
,delai_dec21,12
,delai_sep22,18.1
; Please can you explain me how to draw a curve of evolution of col1 according to the name for each type_college. On the abscissa axis, I have the name appeared in this order ( delai_dec20 , delai_juin21,delai_dec21,delai_sep22). Here is a picture of I want. Thanks in advance.
... View more
10-07-2022
08:30 PM
data students;
input type_college :$16. name $ COL1:4.2 ;
datalines;
College private delai_dec20 1.5
College private delai_juin21 3.6
College private delai_dec21 4.4
College private delai_sep22 47.6
College public delai_dec20 5.3
College public delai_juin21 6
College public delai_dec21 14.4
College public delai_sep22 14.4
University delai_dec20 11.1
University private delai_juin21 14.3
University delai_dec21 14
University delai_sep22 17.1
delai_dec20 5.6
delai_juin21 7.1
delai_dec21 12
delai_sep22 18.1
; I want to replace the blank by "Total" for type_college that's why I used proc format but it doesn't work correctly. proc format;
value $ht
"College public" = 'College public'
"College private" ='College private'
"University" = 'University'
" " ='Total ';
run;
But in the output type_college and name are sorted in ascending order. It display values of type_college in ascending order (college_private college_public university) but I want values displayed in this order ( college public college private university). Also I want name displayed in this order (delai_dec20 delai_juin21 delai_dec21 delai_sep22 ) but I got it in this order (delai_dec20 delai_dec21 delai_juin21 delai_sep22 ) How can I get what I want?. proc tabulate data=students;
var COL1;
CLASS type_college ;
CLASS name ;
/*row statement */
type_college
all= 'Total',
/* Column statement */
name * (COL1 * Sum={LABEL="Somme"});
;
run; Thanks for helping me.
... View more
10-03-2022
11:44 AM
Thanks for solution. It works correctly.
... View more
10-03-2022
11:41 AM
Thanks for correcting the data example step.
... View more
10-01-2022
06:11 PM
Hello, Here is description of my datasets data students; input id:$4 town:$5 Sex:$6 date:$2. var1:8. var2:8. var3:8. ; datalines; id1 Paris Female T0 2 5 8 id2 Paris Female T1 1 8 2 id3 Paris Female T0 3 4 6 id4 Paris Female T1 6 2 9 id5 Paris male T0 1 1 2 id6 Paris male T1 3 5 1 id7 Paris male T0 4 7 8 id8 Paris male T1 2 8 3 id9 rome Female T0 4 5 2 id10 rome Female T1 5 2 8 id11 rome Female T0 2 9 3 id12 rome Female T1 3 7 3 id13 rome male T0 5 5 2 id14 rome male T1 6 3 9 id15 rome male T0 3 7 7 id16 rome male T1 5 7 8 ; I want to create this table with tabulate procedures. I used this code proc tabulate data=students;
var var1 var2 var3;
class date sex town;
table
/* row statement */
town=" " * (var1 *sum var2 * sum var3 * sum) ,
/* column statement */
date*(sex all="sous total ");
;
run; My code works but the problem is that I don't get the subtotals in rows. But I obtain this table I will appreciate your help.
... View more
04-27-2022
01:31 PM
Thank you for your reply. I have summarized the problem. Otherwise I work with a big data where I will have three variables of respective alphanumeric, numeric and binary types. And I want to write a program that will output me that every time my data changes a table in the same format as in the word document.
... View more
04-25-2022
01:40 PM
I have data on 50 (20 girls, 30 boys) students. I have a total of 35 (15 Girls, 20 Boys) students who passed their Maths exam. In my database I have 3 variables: Gender,nb_books , result. The results variable is a binary variable taking the values Yes or No. (Yes if the student passed his Mathematics exam, No if the student failed). I want to create a summary table where in columns I will have the sum of the number of books in mathematics, number of student that passed the exam and the proportion of students who passed the exam. And I will have on the line the variable gender. But I don't know how to calculate the proportions in the table. I converted the result variable into a numeric variable named num_result.So I created a prob variable by using variable result defined as follows: - 1/20 if it is a girl who passed her exam -0 if it is a girl who did not pass her exam. -1/30 if it is a boy who passed his exam -0 if it is a boy who did not pass his exam. And I used sum in a proc tabulate to get the summary table. But the total for the prob variable exceeds 1. Which is not good because I want it to equal 35/50. I used this code. I will appreciate your help. I used SAS EG. See my attached files for examples. proc tabulate data=students;
var num_result nb_books prob;
class gender;
TABLE
/* Row statement */
gender
all = 'Total',
/* column statement */
(num_result = ' ' * Sum={LABEL="Number of student that passed the exam"} nb_books = ' ' * Sum={LABEL="Number of mathematics books"} prob= ' ' * Sum={LABEL= " Proportion of student who passed the exam" );
;
RUN;
... View more