private void button1_Click(object sender, EventArgs e) { double[] coefficients = Mathtool.RegressionCoefficient(dataValues, comboBoxXVariable.SelectedIndex, comboBoxYVariable.SelectedIndex); FrmMain.Instance.GetRegressionCoefficients(coefficients, comboBoxXVariable.SelectedIndex, comboBoxYVariable.SelectedIndex, checkBoxClearData.Checked); FrmMain.Instance.Refresh(); FormLinearRegression.instance.Close(); }
public void GetCoefficient(int i, int j, bool clearData) //^finds the coefficient between the data sets of two variables referenced by their indexes i and j //populates the textbox on the results tab with the results { if (clearData)//clears the text if the user indicated they wished to do so in the previous form { txtStat.Text = ""; } double result = Mathtool.GetCoefficient(dblValues, i, j); txtStat.Text += "Correlation Coefficient between " + colnames[i] + " and " + colnames[j] + " is: " + result.ToString("#.##"); tcStat.SelectedTab = tp2; }
private void button1_Click(object sender, EventArgs e) { foreach (int n in listDS.SelectedIndices) { dataList = new List <double>(); foreach (double[] dataRow in myVal) { if (dataRow != null)//if rows were ommitted in row prepare, then there will be null arrays in myVal { dataList.Add(dataRow[n]); } } result = Mathtool.GetDescriptiveStat(dataList); FrmMain.Instance.descriptiveStatResults(result, colNames[n], clearData); //colNames populated by GetVList } FrmMain.Instance.Refresh(); FormDS.instance.Close(); Debug.WriteLine(FormDS.instance); }