COMPGROUPS.NET | Search | Post Question | Groups | Stream | About | Register

### Statistical calculations on generated variables in simulation study

• Email
• Follow

```How can I carry out statistical calculations such as mean, variance,
correlation matrices for three variables, say Y x1 x2, such that x1
and x2  are generated from multivariate normal while Y is generated
from certain equation and these generations are repeated during a
simulation study?
```
 0

See related articles to this posting

```On Mar 1, 4:37=A0am, ayaa <ayaafa...@gmail.com> wrote:
> How can I carry out statistical calculations such as mean, variance,
> correlation matrices for three variables, say Y x1 x2, such that x1
> and x2 =A0are generated from multivariate normal while Y is generated
> from certain equation and these generations are repeated during a
> simulation study?

Generally you need to loop your program using macro code or using by
groups.

Search Lexjansen.com for papers on simulations in SAS.
Here's a good start though:

http://www2.sas.com/proceedings/forum2007/183-2007.pdf
```
 0

```
"ayaa"  wrote in message

>How can I carry out statistical calculations such as mean, variance,
>correlation matrices for three variables, say Y x1 x2, such that x1
>and x2  are generated from multivariate normal while Y is generated
>from certain equation and these generations are repeated during a
>simulation study?

You could store the means and correlation matrices as macro variables.

```
 0

```On Mar 1, 9:59=A0pm, "Kenneth M. Lin" <kenneth_m_...@sbcglobal.net>
wrote:
> "ayaa" =A0wrote in message
>
>
> >How can I carry out statistical calculations such as mean, variance,
> >correlation matrices for three variables, say Y x1 x2, such that x1
> >and x2 =A0are generated from multivariate normal while Y is generated
> >from certain equation and these generations are repeated during a
> >simulation study?
>
> You could store the means and correlation matrices as macro variables.

1. How can I use each column of a certain matrix as if it is a column
vector instead of being column in a matrix?
2. Here is a nonlinear programming model, it doesn't give me any
output so What is the problem?
3.Concerning the code of " call NLPQN" such as the one below, how can
I specify the shape of the constraints whether >=3D or <=3D ?

start f(x);
f =3D  sumf;
sumf=3D0;
do i =3D 1 to 3;
sumf =3D sumf + (var*l[i])+ (g[i]* k)**2  /(l[i]+  x)**2;
end;
return (f);
finish      f;
start c(x);
c=3Dj(4,1,0);
sumc1=3D0;
do i =3D 1 to 3;
sumc1 =3D sumc1 + (col1[i]**2 *l[i]/(l[i]+x)**2);
end;
c[1]=3D sumc1-10;
sumc2=3D0;
do i=3D 1 to 3;
sumc2 =3D sumc2 + (col2[i]**2 *l[i]/(l[i]+x)**2);
end;
c[2]=3D sumc2-10;
sumc3=3D0;
do i=3D 1 to 3;
sumc3 =3D sumc3 + (col3[i]**2 *l[i]/(l[i]+x)**2);
end;
c[3]=3D sumc3-10;
c[4]=3D (max(l)+x)/(min(l)+x)- (max(l)/min(l));
return (c);
finish c;
x=3D{0};
optn=3Dj(1,11,.); optn[2]=3D3; optn[10]=3D4; optn[11]=3D0;
call nlpqn (rc, xr,  "f", x, optn);
nlc=3D"c";
print x;

Thanks alot
```
 0