I have a code where I'm using the Distribution platform to perform normality checks on multiple columns. Right now, I am using a for-loop to iterate through each column, open a distribution, and then extract the value of the normality test. A subset of the code is shown below. I have an issue where the Distribution platform just opens the same analysis for the first column over and over.
For( i = 1, i <= n, i++,
dist = Distribution(
Invisible,
Continuous Distribution( Column( cols[1] ), Summary Statistics( 1 ), Fit normal( Goodness of Fit( 1 ) ) ),
Histograms Only
);
r = Report( dist );
p = r[Outline Box( "Fitted Normal Distribution" )][Outline Box( "Goodness-of-Fit Test" )][Table Box( 2 )][Number Col Box( 2 )] << get( 1 );
norm = If( p >= 0.05, "Yes", "No" ) || " (p = " || Char( p ) || ")";
dist << Close;
);