Calcite | Level 5

## Re: simulation multivariate ordinal data with 10 variables

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

Calcite | Level 5

## Re: simulation multivariate ordinal data with 10 variables

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

Calcite | Level 5

## Re: simulation multivariate ordinal data with 10 variables

dear dr. rick

i wish to help me to correct this program please.

regards

proc iml;

/* 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"];

Calcite | Level 5

## Re: simulation multivariate ordinal data with 10 variables

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

regards

proc iml;

/* 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"];

Calcite | Level 5

## Re: simulation multivariate ordinal data with 10 variables

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;

/* 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;

Calcite | Level 5

## Re: simulation multivariate ordinal data with 10 variables

dera dr. rick

regards

Calcite | Level 5

## Re: simulation multivariate ordinal data with 10 variables

dear dr. rick

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

regards

SAS Super FREQ

## Re: simulation multivariate ordinal data with 10 variables

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.

Calcite | Level 5

## Re: simulation multivariate ordinal data with 10 variables

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

From The DO Loop
Discussion stats
• 23 replies
• 2999 views
• 5 likes
• 2 in conversation