BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
desireatem
Pyrite | Level 9

    I am tring to multiply this two matrices, I also want to delete all the cases where InverseC=0. How ever, it giving me their locations as a matrix not the matrix;

    SurvivalM=J(nrow(survival1),1,1);

             do i = 1 to n;

                if censored=1 then SurvivalM=survival1; else if censored[1]=0 then SurvivalM=survival1/*****Create a 1 by N -matrix of Survival ****/;

            end;

   

      print SurvivalM;

0.95
0.9
0.8735294
0.8470588
0.7941176
0.7411765
0.6882353
0.6352941
0.5823529
0.5294118
0.4764706
0.4235294
0.3705882
0.3176471
0.2647059
0.2316176
0.1985294
0.1323529
0.0661765
0

    InverseC=J(nrow(survival1),1,1);

          do i = 1 to n;

      if censored=1 then InverseC=1/survival1; else if censored[1]=0 then InverseC=0/*****survivalC is the imputed censored survival and set the real Survivalval to 1**/;

   

     *InverseCC=J(nrow(survival1),1,1);

end;

      print InverseC;

0
0
1.1447811
0
0
0
0
0
0
0
0
0
0
0
0
4.3174603
0
0
0
0

      m=frequency[1];

   *Big=J(nrow(DM),m,value);

      t=(loc(InverseC^=0)); print t;

      tt=t(t); print tt;                      THIS IS WRONG, SUPPOSE TO BE 1.14478 and 4.3174603 as in Inverce above not 3 and 16 which is the location.

tt 2 rows 1 col (numeric)

 

3
16

 

3
16

      reset print;

    Big=SurvivalM*t(tt);  

     print Big;

1 ACCEPTED SOLUTION
1 REPLY 1

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!

Multiple Linear Regression in SAS

Learn how to run multiple linear regression models with and without interactions, presented by SAS user Alex Chaplin.

Find more tutorials on the SAS Users YouTube channel.

From The DO Loop
Want more? Visit our blog for more articles like these.
Discussion stats
  • 1 reply
  • 737 views
  • 0 likes
  • 2 in conversation