open sunspots.gdt # ARMA lag selection with maxima of 4 for p and q arma 4 4 ; sunspots --lagselect # determine the "best" row per BIC (column 4) best_row = iminc($test)[4] # extract this row spec = $test[best_row,][1:2] # extract p and q as scalars scalar p = spec[1] scalar q = spec[2] # and estimate the "best" specification arma p q ; sunspots