21 if (role == Qt::DisplayRole)
22 {
if (index.column()==0)
24 return QString::fromStdString(
MLRset->
Key(index.row()));
26 if (index.column()==1)
28 return mlr->CoefficientsIntercept()[0];
30 if (index.column()==2)
32 return mlr->CoefficientsIntercept()[1];
34 if (index.column()==3)
36 return mlr->P_Value()[0];
38 if (index.column()==4)
40 if (
mlr->Effective(0))
45 if (index.column()==5)
47 return mlr->CoefficientsIntercept()[2];
49 if (index.column()==6)
51 return mlr->P_Value()[1];
53 if (index.column()==7)
55 if (
mlr->Effective(1))
61 if (role == Qt::ItemIsEnabled)
63 if (index.column()==7 || index.column()==4)
69 if (role == Qt::ForegroundRole)
71 if (index.column()==3 &&
mlr->P_Value()[0]<
mlr->PValueThreshold())
72 return QVariant::fromValue(QColor(Qt::red));
73 else if (index.column()==6 &&
mlr->P_Value()[1]<
mlr->PValueThreshold())
74 return QVariant::fromValue(QColor(Qt::red));
76 return QVariant::fromValue(QColor(Qt::black));
84 if (role == Qt::DisplayRole)
86 if (orientation == Qt::Horizontal)
97 return "Coefficient for " + QString::fromStdString(
MLRset->operator[](
MLRset->
Key(0)).GetIndependentVariableNames()[0]);
101 return "P-value for " + QString::fromStdString(
MLRset->operator[](
MLRset->
Key(0)).GetIndependentVariableNames()[0]);
105 return "Correct based on " + QString::fromStdString(
MLRset->operator[](
MLRset->
Key(0)).GetIndependentVariableNames()[0]);
109 return "Coefficient for " + QString::fromStdString(
MLRset->operator[](
MLRset->
Key(0)).GetIndependentVariableNames()[1]);
113 return "P-value for " + QString::fromStdString(
MLRset->operator[](
MLRset->
Key(0)).GetIndependentVariableNames()[1]);
117 return "Correct based on " + QString::fromStdString(
MLRset->operator[](
MLRset->
Key(0)).GetIndependentVariableNames()[1]);