Package edu.cmu.tetrad.regression
Class RegressionDataset
java.lang.Object
edu.cmu.tetrad.regression.RegressionDataset
- All Implemented Interfaces:
Regression
Implements a regression model from tabular continuous data.
- Author:
- josephramsey
-
Constructor Summary
ConstructorsConstructorDescriptionRegressionDataset
(DataSet data) Constructs a linear regression model for the given tabular data set.RegressionDataset
(Matrix data, List<Node> variables) -
Method Summary
Modifier and TypeMethodDescriptiongetGraph()
static RegressionResult
regress
(double[] target, double[][] regressors) Regressestarget
on theregressors
, yielding a regression plane.Regresses the target on the given regressors.void
setAlpha
(double alpha) Sets the alpha level for deciding which regressors are significant based on their p values.void
setRows
(int[] rows)
-
Constructor Details
-
RegressionDataset
Constructs a linear regression model for the given tabular data set.- Parameters:
data
- A rectangular data set, the relevant variables of which are continuous.
-
RegressionDataset
-
-
Method Details
-
regress
-
setAlpha
public void setAlpha(double alpha) Sets the alpha level for deciding which regressors are significant based on their p values.- Specified by:
setAlpha
in interfaceRegression
- Parameters:
alpha
- the significance level.
-
getGraph
- Specified by:
getGraph
in interfaceRegression
- Returns:
- This graph.
-
regress
Regresses the target on the given regressors.- Specified by:
regress
in interfaceRegression
- Parameters:
target
- The target variable.regressors
- The regressor variables.- Returns:
- The regression plane, specifying for each regressors its coefficeint, se, t, and p values, and specifying the same for the constant.
-
regress
Description copied from interface:Regression
Regressestarget
on theregressors
, yielding a regression plane.- Specified by:
regress
in interfaceRegression
- Parameters:
target
- the target variable, being regressed.regressors
- the list of variables being regressed on.- Returns:
- the regression plane.
-
setRows
public void setRows(int[] rows) -
getResidualsWithoutFirstRegressor
-