BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
tianerhu
Pyrite | Level 9
data strength;
input id program$ s1 s2 s3 s4 s5 s6 s7;
datalines;
1 co 81 84 83 83 85 85 85
2 co 77 78 79 79 81 82 81
3 co 84 85 87 89 88 85 86
4 co 74 75 78 78 79 78 78
5 co 76 77 77 77 77 76 76 
6 co 84 84 86 85 86 86 86
7 co 79 80 79 80 80 82 82
8 co 78 78 77 76 75 75 76 
9 co 78 80 77 77 75 75 75
10 co 84 85 85 85 85 83 82
11 co 83 83 85 85 86 87 87
12 RI 79 82 82 83 84 84 82
13 RI 88 89 91 90 93 93 95
14 RI 83 83 84 83 84 86 86
15 RI 81 81 82 82 82 83 85
16 RI 87 88 90 89 89 91 93
17 RI 80 82 83 85 86 88 88
18 RI 82 83 84 84 83 85 87
19 RI 84 85 85 85 86 88 90
20 RI 80 80 82 83 83 84 85
21 RI 85 87 88 88 90 90 91
22 RI 87 88 88 87 87 86 86
;
proc print data=strength;
run;
proc sort data=strength;
by program;
run;
proc means data=strength mean std var;
var s1 s2 s3 s4 s5 s6 s7;
by program;
run;

data means;
input meancont meanri time;
datalines;
79.8181818 3.5726232 12.7636364   
80.8181818 3.5445220 12.5636364   
81.1818182 4.0204025 16.1636364   
81.2727273 4.3148791 18.6181818   
81.5454545 4.6981621 22.0727273   
81.2727273 4.5186482 20.4181818   
81.2727273 4.4517617 19.8181818   
;
proc sgplot data=means;
series x=time y=meanri/markers;
series x=time y=meancont/markers;
xaxis label='Time(in days)' values=(1 to 14 by 2);
yaxis label='Mean Strength';
title 'mean strength vs time';
run;
title;

1 ACCEPTED SOLUTION

Accepted Solutions
ed_sas_member
Meteorite | Level 14

Hi @tianerhu 

 

In your code, the x axis (representing time) displays values from 1 to 14 by 2:

xaxis label='Time(in days)' values=(1 to 14 by 2);

However, times values seem to go from 12 to 22:

data means;
input meancont meanri time;
datalines;
79.8181818 3.5726232 12.7636364   
80.8181818 3.5445220 12.5636364   
81.1818182 4.0204025 16.1636364   
81.2727273 4.3148791 18.6181818   
81.5454545 4.6981621 22.0727273   
81.2727273 4.5186482 20.4181818   
81.2727273 4.4517617 19.8181818  

-> you need to adapt the axis statement. E.g.

xaxis label='Time(in days)' values=(10 to 24 by 2); 

 

Does that answer your question?

Best,

View solution in original post

8 REPLIES 8
ed_sas_member
Meteorite | Level 14

Hi @tianerhu 

 

In your code, the x axis (representing time) displays values from 1 to 14 by 2:

xaxis label='Time(in days)' values=(1 to 14 by 2);

However, times values seem to go from 12 to 22:

data means;
input meancont meanri time;
datalines;
79.8181818 3.5726232 12.7636364   
80.8181818 3.5445220 12.5636364   
81.1818182 4.0204025 16.1636364   
81.2727273 4.3148791 18.6181818   
81.5454545 4.6981621 22.0727273   
81.2727273 4.5186482 20.4181818   
81.2727273 4.4517617 19.8181818  

-> you need to adapt the axis statement. E.g.

xaxis label='Time(in days)' values=(10 to 24 by 2); 

 

Does that answer your question?

Best,

tianerhu
Pyrite | Level 9

thank you for your help , i love here

tianerhu
Pyrite | Level 9

it works now , thank you .

tianerhu
Pyrite | Level 9
data strength;
input id program$ s1 s2 s3 s4 s5 s6 s7;
datalines;
1 co 81 84 83 83 85 85 85
2 co 77 78 79 79 81 82 81
3 co 84 85 87 89 88 85 86
4 co 74 75 78 78 79 78 78
5 co 76 77 77 77 77 76 76 
6 co 84 84 86 85 86 86 86
7 co 79 80 79 80 80 82 82
8 co 78 78 77 76 75 75 76 
9 co 78 80 77 77 75 75 75
10 co 84 85 85 85 85 83 82
11 co 83 83 85 85 86 87 87
12 RI 79 82 82 83 84 84 82
13 RI 88 89 91 90 93 93 95
14 RI 83 83 84 83 84 86 86
15 RI 81 81 82 82 82 83 85
16 RI 87 88 90 89 89 91 93
17 RI 80 82 83 85 86 88 88
18 RI 82 83 84 84 83 85 87
19 RI 84 85 85 85 86 88 90
20 RI 80 80 82 83 83 84 85
21 RI 85 87 88 88 90 90 91
22 RI 87 88 88 87 87 86 86
;
proc print data=strength;
run;
proc sort data=strength;
by program;
run;
proc means data=strength mean std var;
var s1 s2 s3 s4 s5 s6 s7;
by program;
run;

data means;
input meancont meanri time;
datalines;
79.8181818 83.2727273   1
80.8181818 84.3636364   3
81.1818182 85.3636364   5
81.2727273 85.3636364   7
81.5454545 86.0909091   9
81.2727273 87.0909091   11
81.2727273 88.0000000   13
;
proc sgplot data=means;
series x=time y=meanri/markers;
series x=time y=meancont/markers;
xaxis label='Time(in days)' values=(1to 14 by 2);
yaxis label='Mean Strength';
title 'mean strength vs time';
run;
title;

ed_sas_member
Meteorite | Level 14

That seems great now!

tianerhu
Pyrite | Level 9

thank you so much.

mkeintz
Jade | Level 19

Please mark one of @ed_sas_member 's responses as the solution.

--------------------------
The hash OUTPUT method will overwrite a SAS data set, but not append. That can be costly. Consider voting for Add a HASH object method which would append a hash object to an existing SAS data set

Would enabling PROC SORT to simultaneously output multiple datasets be useful? Then vote for
Allow PROC SORT to output multiple datasets

--------------------------
tianerhu
Pyrite | Level 9

thank you

SAS INNOVATE 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

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.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

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

View all other training opportunities.

Discussion stats
  • 8 replies
  • 734 views
  • 1 like
  • 3 in conversation