* a); proc format; value sesn 1 = 'winter' 2 = 'spring' 3 = 'summer' 4 = 'fall' 5 = 'annual'; run; filename npolar url 'http://www.stat.ncsu.edu/people/rasathurai/courses/st445/npolar.dat'; * Can also read the data as 'it is' and use proc transpose as shown below; /* data npolar; infile npolar firstobs=25 obs=77; input year 1-4 winter 8-12 spring 15-19 summer 22-26 fall 29-33 annual 36-40; run; proc print data = npolar(obs=10);run; proc transpose data = npolar out=npolar1(rename=(_name_=season col1 = temp)); by year; run; proc print data = npolar1(obs=10);run; */ data npolar; infile npolar firstobs=25 obs=77; input year @; do season = 1 to 5; input surf @; if season = 5 then date =.; else date=mdy(season*3-2,1,year); output; end; run; proc print data = npolar(obs=10); format season sesn. date date10.;run; * b); pattern1 symbol color=red; axis1 label=(a=90 f="Arial/Bold" "Surface Temperature") order=(-2 to 4 by 1); axis2 label= (f="Arial/Bold" "Years") order=(1958 to 2010 by 4 ) /*order=(-730 to 18250 by 1461 )*/; title1 "Temperature Vs Time"; /* use all seasons except annual Note the where statement */ proc gplot data=npolar(where=(season ne 5)); plot surf*year /*date */=season/vaxis=axis1 haxis=axis2; title 'Surface Temperature Over Time'; format date date10. season sesn.; run; * (c)avg= (0.7375 + 0.6013 + 0.1955 + 0.3355)/4 = 1.8698/4= 0.46745 ~= annual vaerage = 0.7756; proc means data = npolar mean std maxdec=4; class season; var surf; format season sesn.; run; *(d) Winter has the highest variance as shown in (c); *e) ; /* Only use annual surf values */ proc reg data=npolar(where=(season=5)); model surf = year; title; run;