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.
- Version:
- $Id: $Id
- Author:
- josephramsey
-
Constructor Summary
ConstructorsConstructorDescriptionRegressionDataset
(DataSet data) Constructs a linear regression model for the given tabular data set.RegressionDataset
(Matrix data, List<Node> variables) Constructor for RegressionDataset. -
Method Summary
Modifier and TypeMethodDescriptiongetGraph()
Getter for the fieldgraph
.getResidualsWithoutFirstRegressor.static RegressionResult
regress
(double[] target, double[][] regressors) regress.regress.Regresses the target on the given regressors.void
setAlpha
(double alpha) Sets the significance level at which coefficients are judged to be significant.void
setRows
(int[] rows) Setter for the fieldrows
.
-
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
regress.
- Parameters:
target
- an array of objectsregressors
- an array of objects- Returns:
- a
RegressionResult
object
-
setAlpha
public void setAlpha(double alpha) Sets the significance level at which coefficients are judged to be significant.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
Getter for the field
graph
.- 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
regress.
- Specified by:
regress
in interfaceRegression
- Parameters:
target
- aNode
objectregressors
- aNode
object- Returns:
- a
RegressionResult
object
-
setRows
public void setRows(int[] rows) Setter for the field
rows
.- Parameters:
rows
- an array of objects
-
getResidualsWithoutFirstRegressor
-