0

I want to create these ini minitab :

  1. Create a Local Macro to find the variance of X
  2. Create a Local Macro to find the covariance of X and Y
  3. Create Create a Local Macro to find the variance covariance matrix of X and Y
  4. 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

0 Answers0