I want to create these ini minitab :
- Create a Local Macro to find the variance of X
- Create a Local Macro to find the covariance of X and Y
- Create Create a Local Macro to find the variance covariance matrix of X and Y
- Create a Local Macro to find the correlation coefficient of X and Y
here is an example for no 1 but still have some mistakes :
macro
variance c1
MCOLUMN c1 c2 c3 c4
MCONSTANT qwe rata1 jumlah1
let rata1=mean(c1)
let jumlah1= count(c1)
do qwe=1:jumlah1
let c2(qwe)=(c1(qwe)-rata1)^2
enddo
let varix=sum(c2)/(jumlah1-1)
let stdvx=sqrt(varix)
let c3=varix
let c4=stdvx
name c3 "var X"
name c4 "stdev X"
name c1 "X"
name c2 "(X-Xbar)^2"
endmacro