CIAO,
Sono nuovo nella programmazione e ho difficoltà a costruire uno script funzionante
dt = current data table();
//declaring and initializing variables//
lt_min = 1;
lt_max = 50;
RSquare_th = 0.9999;
count = 0;
//loop
while (count < 0.99999,
//calculate x for each y value
dt << New Column ("x", Numeric, formula(:y/ (:y + :avg_num)));
//plot bivariate
biv = dt << Bivariate(
Y( :x ),
X( :average_temp),
Fit Line( {Line Color( {212, 73, 88} )} ));
Bivariate_report = biv << report;
pt = Bivariate_report [Table Box(1)];
pt << Make Combined Data Table();
pt = Bivariate_report [Table Box(3)];
pt << Make Combined Data Table();
);
//get rsquare
rsquare << send (Bivariate Fit);
rsquare << send(Get Gen RSquare Test);
//check Rsq
if (rsquare < RSquare_th,
//increment light by 1
lt_min = lt_min +1,
count = count +1,
//update data table
dt << New Column("light", Numeric, formula(lt_min)),
//exit loop if RSQ >= threshold
print("Search Completed. RSQ >= threshold"),
);