I essentially want to calculate the mean and standard deviation of each column of a matrix. But of course its not that simple.
Here is my code so far:
forval aa=1/100 {
local bb=`aa'/100
gen ln_port_`aa'=(`bb'*X) + ((1-`bb')*Y)
}
This creates of course 100 vectors of the format ln_port_1, ln_port_2,....,ln_port_100
I would like to then create two new vectors; vector one would contain the standard deviations of each of the 100 vectors and vector 2 would contain the means of the 100 vectors.
Thanks for any help.
Here is my code so far:
forval aa=1/100 {
local bb=`aa'/100
gen ln_port_`aa'=(`bb'*X) + ((1-`bb')*Y)
}
This creates of course 100 vectors of the format ln_port_1, ln_port_2,....,ln_port_100
I would like to then create two new vectors; vector one would contain the standard deviations of each of the 100 vectors and vector 2 would contain the means of the 100 vectors.
Thanks for any help.
Comment