Date: Fri, 14 Nov 1997 09:16:48 PST
Reply-To: TWB2%Rates%FAR@bangate.pge.com
Sender: "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From: Tim Berryhill 3rd time <TWB2%Rates%FAR@BANGATE.PGE.COM>
Subject: Re: What is wrong?
The code looks reasonable (although I prefer explicit arrays rather than
implicit arrays). Some sort of rounding error seems unlikely, but you might
want to change your error message to:
PUT _ALL_ 'P-value greater than 0.05 but sign is *'; to see what value is in
the odd rr variable. This will dump all six RR variables, but you can find the
bad one using the value of _I_.
The simplest way I can see for this to happen is if SIG1-SIG6 are already
defined in TEMP1 and some of them happen to have the value * already. You might
want to add an ELSE clause:
if rr =< 0.05 and rr ne . then signn='*';
ELSE SIGNN=' ';
Tim Berryhill - Contract Programmer and General Wizard
TWB2@PGE.COM or http://www.aartwolf.com/twb.html
Frequently at Pacific Gas & Electric Co., San Francisco
The correlation coefficient between their views and
my postings is slightly less than 0
----------------------[Reply - Original Message]----------------------
Sent by:"Fang Chen" <3edeb@CA.PMC-VACC.COM>
Hi, SAS-users,
I am trying sign a star to those value less than and equal to 0.05,
but it seems stars are also signed to those of value greater than 0.05.
Does any body know what happen? Thank you advance.
SAS CODE:
data temp; set temp1;
keep rr1 rr2 rr3 rr4 rr5 rr6
sig1 sig2 sig3 sig4 sig5 sig6;
array rr rr1-rr6;
array signn $ sig1-sig6;
do over rr;
if rr =< 0.05 and rr ne . then signn='*';
if rr gt 1 then put ' P-value is greater than 1';
if signn='*' and rr gt 0.05 then do;
put ' p-value greater than 0.05 but sign is *';
end;
end;
run;
data temp; set temp1;
621 keep rr1 rr2 rr3 rr4 rr5 rr6
622 sig1 sig2 sig3 sig4 sig5 sig6;
623 array rr rr1-rr6;
624 array signn $ sig1-sig6;
625 do over rr;
626 if rr Le 0.05 and rr ne . then signn='*';
627
628 if rr gt 1 then put ' P-value is greater than 1';
629
630 if signn='*' and rr gt 0.05 then do;
631 put ' p-value greater than 0.05 but sign is *';
632 end;
633 end;
634
p-value greater than 0.05 but sign is *
p-value greater than 0.05 but sign is *
NOTE: The data set WORK.TEMP has 108 observations and 15 variables.
NOTE: The PROCEDURE SORT used 0.27 seconds.
=====================================================================