BookmarkSubscribeRSS Feed
R_A_G_
Calcite | Level 5

would some one help with this code. Instead of 0 1 2 3 I get only 0's and 1's why?

data IEEE.item_coded (drop=item1-item116 iii);

set IEEE.item;

array f_item(116);

array item(*) item1-item116;

do iii=1 to 116;

  if item{iii}<0.000623175 then f_item{iii}=3;

   else if item{iii} lt 0.002864969 then f_item{iii}=2;

   else if item{iii} lt 0.013617708 then f_item{iii}=1;

   else if item{iii} le 0.431834293 then f_item{iii}=0;

  if item{iii} lt 0.001041523 then f_item{iii}=2;

   else if item{iii} lt 0.008116862 then f_item{iii}=1;

   else if item{iii} le 0.431834293 then f_item{iii}=0;

  if item{iii} lt 0.002864969 then f_item{iii}=1;

   else if item{iii} le 0.431834293 then f_item{iii}=0;

end;

run;

1 REPLY 1
art297
Opal | Level 21

Tom already replied to this in a duplicate posting you made.  I have to ask: "did you really intend on having duplicate if-then-else statements?  The first four lines, under your do loop, recode the values.  What, if any, was the purpose of the second and third groups of if-then-else statements?

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

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

View all other training opportunities.

Discussion stats
  • 1 reply
  • 699 views
  • 0 likes
  • 2 in conversation