sas 9.0 Put two graphics - sas

I am facing a technical problem in SAS 9.2.
Here is an example code:
proc sgplot data=sashelp.class;
reg y=Age x=height;
run;
proc sgplot data=sashelp.class;
scatter y=Age x=weight;
run;
I would like to put the 2 graphics together.
How can I do it easily?
Thanks.

Related

proc sgpanel reg only on one modality of group

I have some computing problem with SAS 9.2.
Here is my code:
data test;
set sashelp.cars;
WHERE Make in ('Acura', 'Audi');
run
proc sgpanel data=test;
panelby origin;
reg y=Weight x=Length/group=Make;
run;
The regression option is applied on the 2 modalities of the variable Make.
Is it possible to allpy it only one one of them? For instance, only on the Make 'Audi'?
Thanks a lot.
Just make two separate plots with sgplot.
/* regression plot for the one you need the regression */
proc sgplot data=sashelp.cars;
WHERE Make eq 'Audi';
reg y=Weight x=Length/group=Make;
run;
/* scatter plot for the one you need no regression */
proc sgplot data=sashelp.cars;
WHERE Make eq 'Acura';
scatter y=Weight x=Length/group=Make;
run;
Also not I integrated the selection in the graphical procedure.

How to have multiple graphs generated by one gplot procedure output to a single PDF file?

The following GPLOT procedure generates many graphs(It gives sales by different product). Say if my product has 'Sofa', 'bed', 'Chairs', it will give 3 graphs, one for sofa, one for chairs, one for bed.
I'd like to have all the three graphs generated to be output to one single PDF file. I tried the following, but it only keep the last graph generated. Any ideas how I can do this?
ODS PDF FILE= 'OUTPUT.PDF';
PROC GPLOT data = AB.TEMP;
plot sales*Months=Product;
by Region;
run;
ODS PDF CLOSE;
Thanks!
Sandwich your code between ODS PDF and ODS PDF CLOSE statements.
ODS PDF FILE='my_file.pdf' style=meadow;
PROC GPLOT data = AB.TEMP;
plot sales*Months=Product;
by Region;
run;
ODS PDF CLOSE;
Does this work for you? If so, then you have something wrong in your code. Post your code and log in that case.
proc sort data=sashelp.cars out=cars;
by origin;
run;
ods pdf file="C:\_localdata\temp.pdf" style=meadow;
proc gplot data=cars;
plot mpg_city*msrp=make;
by origin;
run;
ods pdf close;

SAS 9.3 goptions ignores gsfname

Sorry for my bad english :)
I need to export gif picture from SAS proc gchart:
filename graphout "&PATH.\file.gif";
goptions gsfname=graphout dev=gif gsfmode=replace;
proc gchart data=work.temp;
/*forming chart*/
run;
quit;
filename graphout clear;
But export occurs in the work directory. What's the problem?
I can't figure out what the problem is with the option, but I recommend not using that to create your graphics in any event. ODS is much easier to use. There are a lot of ways to do this in ODS; the HTML destination is usually the easiest:
ods html gpath="c:\temp\" path="c:\temp\";
proc gchart data=sashelp.class;
vbar age/group=sex name="mychart";
run;
quit;
I faced same problem with you. After I tried to put
ods listing;
before your code, it works.

Seasonal Sub Series Plot in SAS

I'm studying a seasonal monthly time series and I like to plot the Seasonal Sub Series Plot or a Box Plot by Month in SAS.
Somthing like the ones at the bottom of the page at the following link:
http://www.itl.nist.gov/div898/handbook/pmc/section4/pmc443.htm
I'm not sure how exactly to get this done in SAS. I appreciate any help.
SE
Can't speak to the seasonality, but box plots are pretty simple. Assuming you create a SAS dataset from the data in that web site, try this:
proc format ;
value mn_name 1='January'
2='February'
3='March'
4='April'
5='May'
6='June'
7='July'
8='August'
9='September'
10='October'
11='November'
12='December'
other='Invalid';
run;
proc sort data=have;
by month;
run;
proc boxplot data=have;
plot Oscillation*month;
format month mn_name.;
run;

Output values to excel in sas

Can some one please help me to output the data generated from the following code(yt) to an excel data set?
proc iml;
d = 0.4;
call farmasim(yt, d) n=10 sigma=2 seed=123457;
print yt;
run;
ods tagsets.excelxp file="myfile.xml";
proc iml ... etc. ... quit;
ods tagsets.excelxp close;
For more info google "tagsets.excelxp" or see http://support.sas.com/rnd/base/ods/odsmarkup/excelxp_demo.html
Alternately, you can move yt into a dataset, and use PROC EXPORT, either to EXCEL if you have ACCESS to PC FILES licensed, or to CSV if not.