LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (April 2009, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Thu, 2 Apr 2009 21:37:48 -0400
Reply-To:     Arthur Tabachneck <art297@NETSCAPE.NET>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Arthur Tabachneck <art297@NETSCAPE.NET>
Subject:      Re: Code + Proc Reg + Obtain standard error of residuals for each
              model.
Comments: To: barry.brian.barrios@GMAIL.COM

Brian,

It sounds like you only want to rearrange your output file. You could use proc transpose, or you could simply grab what you want from a data step. E.g.,:

data want (keep=model parms: tval:); retain model parmsRT tvalRT parmsWT tvalWT stderrRT stderrWT; set regpe; by _model_; label parmsRT='Parms(RUntime)'; label parmsWT='Parms(Weigh)'; label TvalRT='tvalue(Runtime)'; label TvalWT='t tvalue'; model=_model_; if _type_ eq 'PARMS' then do; parmsRT=runtime; parmsWT=weight; end; else if _type_ eq 'T' then do; tvalRT=runtime; tvalWT=weight; end; else if _type_ eq 'STDERR' then do; stderrRT=runtime; stderrWT=weight; end; if last._model_ then output; run;

proc print data=want label; run;

HTH, Art -------- On Thu, 2 Apr 2009 17:26:35 -0700, barry.brian.barrios@GMAIL.COM wrote:

>Below is the code, there was a slight but it is fixed now. > >/* SAS CODE FOLLOWS */ >data fitness; > input age weight oxy runtime rstpulse runpulse maxpulse; > cards; > 44 89.47 44.609 11.37 62 178 182 > 40 75.07 45.313 10.07 62 185 185 > 44 85.84 54.297 8.65 45 156 168 > 42 68.15 59.571 8.17 40 166 172 > 38 89.02 49.874 9.22 55 178 180 > 47 77.45 44.811 11.63 58 176 176 > 40 75.98 45.681 11.95 70 176 180 > 43 81.19 49.091 10.85 64 162 170 > 44 81.42 39.442 13.08 63 174 176 > 38 81.87 60.055 8.63 48 170 186 > 44 73.03 50.541 10.13 45 168 168 > 45 87.66 37.388 14.03 56 186 192 > 45 66.45 44.754 11.12 51 176 176 > 47 79.15 47.273 10.60 47 162 164 > 54 83.12 51.855 10.33 50 166 170 > 49 81.42 49.156 8.95 44 180 185 > 51 69.63 40.836 10.95 57 168 172 > 51 77.91 46.672 10.00 48 162 168 > 48 91.63 46.774 10.25 48 162 164 > 49 73.37 50.388 10.08 67 168 168 > 57 73.37 39.407 12.63 58 174 176 > 54 79.38 46.080 11.17 62 156 165 > 52 76.32 45.441 9.63 48 164 166 > 50 70.87 54.625 8.92 48 146 155 > 51 67.25 45.118 11.08 48 172 172 > 54 91.63 39.203 12.88 44 168 172 > 51 73.71 45.790 10.47 59 186 188 > 57 59.08 50.545 9.93 49 148 155 > 49 76.32 48.673 9.40 56 186 188 > 48 61.24 47.920 11.50 52 170 176 > 52 82.78 47.467 10.50 53 170 172 >; >run; > > > > >proc reg data=fitness >outest=regpe(keep=_MODEL_ _TYPE_ _DEPVAR_ Intercept runtime weight > _RSQ_ _ADJRSQ_)tableout; > >model1: model oxy=runtime weight/adjrsq; > output out=out1 residual=residual1; > >model2: model maxpulse=runtime weight/adjrsq; > output out=out2 residual=residual2; >model3: model runpulse=runtime weight/adjrsq; > output out=out3 residual=residual3; >run; > >/* print data set for parameter estimates table and rsquare statistics >*/ >proc print data=regpe; >run; > >/* one data set for all the OUTPUT data sets for each model */ >data final; merge out1 out2 out3; >run; > >/* print the data set for all the OUTPUT data setts for each model */ >proc print data=final; >var oxy maxpulse runpulse runtime weight residual1 residual2 >residual3; >run; > > > > > >On Apr 2, 8:23 pm, barry.brian.barr...@gmail.com wrote: >> Below is the code, I just ran it and it works. I will forward also >> the SAS-L list, sorry about that. >> >> Ok, now what I want as an output is the following not like regpe but >> Like this: >> model Parms(RUntime) tvalue(Runtime) Parms(Weigh)t tvalue >> (Weight) _RSQ_ _ADJRSQ_ >> model1 -0.37627 -2.97504 -0.09925 >> -0.89861 0.24987 0.19629 >> model2 -0.07026 -0.30471 0.27067 >> 01.34427 0.06566 -0.00108 >> model3 -2.38075 -7.92655 0.29115 >> 1.11004 0.70097 0.67961 >> >> I would also like to include the standard error of the residuals for >> each model. >> >> /* SAS CODE FOLLOWS */ >> data fitness; >> input age weight oxy runtime rstpulse runpulse maxpulse; >> cards; >> 44 89.47 44.609 11.37 62 178 182 >> 40 75.07 45.313 10.07 62 185 185 >> 44 85.84 54.297 8.65 45 156 168 >> 42 68.15 59.571 8.17 40 166 172 >> 38 89.02 49.874 9.22 55 178 180 >> 47 77.45 44.811 11.63 58 176 176 >> 40 75.98 45.681 11.95 70 176 180 >> 43 81.19 49.091 10.85 64 162 170 >> 44 81.42 39.442 13.08 63 174 176 >> 38 81.87 60.055 8.63 48 170 186 >> 44 73.03 50.541 10.13 45 168 168 >> 45 87.66 37.388 14.03 56 186 192 >> 45 66.45 44.754 11.12 51 176 176 >> 47 79.15 47.273 10.60 47 162 164 >> 54 83.12 51.855 10.33 50 166 170 >> 49 81.42 49.156 8.95 44 180 185 >> 51 69.63 40.836 10.95 57 168 172 >> 51 77.91 46.672 10.00 48 162 168 >> 48 91.63 46.774 10.25 48 162 164 >> 49 73. >> 37 50.388 10.08 67 168 168 >> 57 73.37 39.407 12.63 58 174 176 >> 54 79.38 46.080 11.17 62 156 165 >> 52 76.32 45.441 9.63 48 164 166 >> 50 70.87 54.625 8.92 48 146 155 >> 51 67.25 45.118 11.08 48 172 172 >> 54 91.63 39.203 12.88 44 168 172 >> 51 73.71 45.790 10.47 59 186 188 >> 57 59.08 50.545 9.93 49 148 155 >> 49 76.32 48.673 9.40 56 186 188 >> >48 61.24 47.920 11.50 52 170 176 >> 52 82.78 47.467 10.50 53 170 172 >> ; >> run; >> >> proc reg data=fitness >> outest=regpe(keep=_MODEL_ _TYPE_ _DEPVAR_ Intercept runtime weight >> _RSQ_ _ADJRSQ_)tableout; >> >> model1: model oxy=runtime weight/adjrsq; >> output out=out1 residual=residual1; >> >> model2: model maxpulse=runtime weight/adjrsq; >> output out=out2 residual=residual2; >> model3: model runpulse=runtime weight/adjrsq; >> output out=out3 residual=residual3; >> run; >> >> /* print data set for parameter estimates table and rsquare statistics >> */ >> proc print data=regpe; >> run; >> >> /* one data set for all the OUTPUT data sets for each model */ >> data final; merge out1 out2 out3; >> run; >> >> /* print the data set for all the OUTPUT data setts for each model */ >> proc print data=final; >> var oxy maxpulse runpulse runtime weight residual1 residual2 >> residual3; >> run;


Back to: Top of message | Previous page | Main SAS-L page