BookmarkSubscribeRSS Feed
thanoon
Calcite | Level 5

I mean my program not your program as you see I simulate p and  r   matrix  by using your program thank you very much for your help but when I put in my program also I see  errors.i wish to help me.

Regards

thanoon
Calcite | Level 5

I mean my program not your program as you see I simulate p and r matrix by using your program thank you for your help but when I put these matrices in my program also I have a problem with the program .I wish to help me.

Regards

thanoon
Calcite | Level 5

dear dr. rick

i wish to help me to correct this program please.

regards

proc iml;

load module=_all_;                     /* load the modules */

    /* P1    P2     P3       p4     p5      p6       p7      p8     p9      p10 */

P = {0.05 0.05 0.05 0.1    0.05 0.05 0.1     0.1 0.1    0.2,

     0.05 0.05 0.2    0.1    0.2    0.05 0.15 0.05 0.05    0.1,

     0.05 0.1    0.05 0.2    0.05 0.05 0.05 0.2    0.2    0.1,

     0.05 0.2    0.2    0.15 0.1    0.05 0.05 0.2    0.05    0.15,

     0.05 0.1    0.05 0.05 0.1    0.15 0.2    0.05 0.05 0.05,

     0.1 0.15 0.1    0.05 0.05 0.2    0.2    0.05 0.2    0.05,

     0.1 0.05 0.1    0.05 0.15 0.1    0.05 0.05 0.05 0.05,

     0.15 0.2    0.15 0.2    0.05 0.1    0.1    0.05 0.1    0.2,

     0.2 0.05 0.05 0.05 0.2    0.2    0.05 0.1    0.15 0.05,

     0.2 0.05 0.05 0.05 0.05 0.05 0.05 0.15 0.05 0.05};

/* expected values and variance for each ordinal variable */

Expected = OrdMean(P) // OrdVar(P);

varNames = "X1":"X10";

print Expected[r={"Mean" "Var"} c=varNames];

/* test the RandMVOrd function */

Delta = {1  0.45 0.4   0.35 0.3    0.25 0.2    0.15 0.1    0.05,

        0.45 1 0.45 0.4    0.35 0.3    0.25 0.2    0.15 0.1,

        0.4  0.45 1   0.45    0.4    0.35 0.3    0.25 0.2    0.15,

        0.35  0.4 0.45 1    0.45 0.4    0.35 0.3    0.25 0.2,

        0.3  0.35 0.4   0.45     1    0.45 0.4    0.35 0.3    0.25,

        0.25  0.3 0.35 0.4    0.45   1    0.45 0.4    0.35 0.3,

        0.2  0.25 0.3   0.35    0.4    0.45 1    0.45 0.4    0.35,

        0.15  0.2 0.25 0.3   0.35 0.4    0.45   1    0.45 0.4,

        0.1  0.15 0.2   0.25   0.3    0.35 0.4    0.45   1    0.45,

        0.05  0.1 0.15 0.2 0.25 0.3    0.35 0.4   0.45     1};

call randseed(54321);

X = RandMVOrdinal(1000, P, Delta);

print first[label="First 1000 Obs: Multivariate Ordinal"];

thanoon
Calcite | Level 5

after some corrections i got on mean and variance only but i want data.

regards

proc iml;

load module=_all_;                     /* load the modules */

    /* P1    P2     P3       p4     p5      p6       p7      p8     p9      p10 */

P = {0.05 0.05 0.05 0.1    0.05 0.05 0.1     0.1 0.1    0.2,

     0.05 0.05 0.2    0.1    0.2    0.05 0.15 0.05 0.05    0.1,

     0.05 0.1    0.05 0.2    0.05 0.05 0.05 0.2    0.2    0.1,

     0.05 0.2    0.2    0.15 0.1    0.05 0.05 0.2    0.05    0.15,

     0.05 0.1    0.05 0.05 0.1    0.15 0.2    0.05 0.05 0.05,

     0.1 0.15 0.1    0.05 0.05 0.2    0.2    0.05 0.2    0.05,

     0.1 0.05 0.1    0.05 0.15 0.1    0.05 0.05 0.05 0.05,

     0.15 0.2    0.15 0.2    0.05 0.1    0.1    0.05 0.1    0.2,

     0.2 0.05 0.05 0.05 0.2    0.2    0.05 0.1    0.15 0.05,

     0.2 0.05 0.05 0.05 0.05 0.05 0.05 0.15 0.05 0.05};

/* expected values and variance for each ordinal variable */

Expected = Mean(P) // Var(P);

varNames = "X1":"X10";

print Expected[r={"Mean" "Var"} c=varNames];

/* test the RandMVOrd function */

Delta = {1  0.45 0.4   0.35 0.3    0.25 0.2    0.15 0.1    0.05,

        0.45 1 0.45 0.4    0.35 0.3    0.25 0.2    0.15 0.1,

        0.4  0.45 1   0.45    0.4    0.35 0.3    0.25 0.2    0.15,

        0.35  0.4 0.45 1    0.45 0.4    0.35 0.3    0.25 0.2,

        0.3  0.35 0.4   0.45     1    0.45 0.4    0.35 0.3    0.25,

        0.25  0.3 0.35 0.4    0.45   1    0.45 0.4    0.35 0.3,

        0.2  0.25 0.3   0.35    0.4    0.45 1    0.45 0.4    0.35,

        0.15  0.2 0.25 0.3   0.35 0.4    0.45   1    0.45 0.4,

        0.1  0.15 0.2   0.25   0.3    0.35 0.4    0.45   1    0.45,

        0.05  0.1 0.15 0.2 0.25 0.3    0.35 0.4   0.45     1};

call randseed(54321);

X = RandMVOrdinal(1000, P, Delta);

print first[label="First 1000 Obs: Multivariate Ordinal"];

thanoon
Calcite | Level 5

dear dr. rick

i want to ask you regarding this program i conducedt this program and got on data after then i close the sas page ans save the conmand and i returned to open this program and press on run i saw some errors can you help me to know what is the problem .

regards

proc iml;

load module=_all_;                     /* load the modules */

    /* P1    P2     P3       p4     p5      p6       p7      p8     p9      p10 */

P = {0.35 0.50 0.20 0.10   0.10   0.30    0.20 0.25 0.15 0.20,

     0.30 0.10 0.20 0.30   0.20   0.20    0.40 0.05 0.45    0.10,

     0.15 0.20    0.35 0.25   0.50   0.20    0.25 0.55 0.10 0.10,

     0.20 0.20 0.25 0.35   0.20   0.30    0.15 0.15 0.30    0.60};

/* expected values and variance for each ordinal variable */

Expected = Mean(P) // Var(P);

varNames = "X1":"X10";

print Expected[r={"Mean" "Var"} c=varNames];

/* test the RandMVOrd function */

Delta = {1  0.45 0.4   0.35 0.3    0.25 0.2    0.15 0.1    0.05,

        0.45 1 0.45 0.4    0.35 0.3    0.25 0.2    0.15 0.1,

        0.4  0.45 1   0.45    0.4    0.35 0.3    0.25 0.2    0.15,

        0.35  0.4 0.45 1    0.45 0.4    0.35 0.3    0.25 0.2,

        0.3  0.35 0.4   0.45     1    0.45 0.4    0.35 0.3    0.25,

        0.25  0.3 0.35 0.4    0.45   1    0.45 0.4    0.35 0.3,

        0.2  0.25 0.3   0.35    0.4    0.45 1    0.45 0.4    0.35,

        0.15  0.2 0.25 0.3   0.35 0.4    0.45   1    0.45 0.4,

        0.1  0.15 0.2   0.25   0.3    0.35 0.4    0.45   1    0.45,

        0.05  0.1 0.15 0.2 0.25 0.3    0.35 0.4   0.45     1};

call randseed(54321);

X = RandMVOrdinal(1000, P, Delta);

/* print results */

c=varNames;

create MVO from X[colname=c];  append from X;  close MVO;

quit;

thanoon
Calcite | Level 5

dera dr. rick

i wait your answer please help me.

regards

thanoon
Calcite | Level 5

dear dr. rick

i want to know how can i set the value of X please.

regards

Rick_SAS
SAS Super FREQ

This is a community forum, not a personal help site, so please address your comments to the community.

I have given you lots of help on this problem and I encouage you to read, study, and experiment in order to solve any remaining issues that you have.  Other experts might offer assistance if they have time.

I am currently on vacation and out of the office until January.

thanoon
Calcite | Level 5

thank you so much for your support to me and i am sorry to write your name in this forum because you only answer me.

i conducted this program before three days and i got on data for multivariate ordinal and binary data but now i cannot get on data why i dont know i saw your book and sas help and i think i wrote this program exatly "the problem in value of X how can i write a quation of X to get on data i wish to write to me how can i correct this program.

merry christmas and happy new year

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
  • 23 replies
  • 2999 views
  • 5 likes
  • 2 in conversation