- due to changes in struct (removal of unicode)
... | ... |
@@ -33,7 +33,7 @@ In univariate classical least squares regression a line is fitted between each f |
33 | 33 |
\section{Inheritance}{ |
34 | 34 |
|
35 | 35 |
A \code{classical_lsq} object inherits the following \code{struct} classes: \cr\cr |
36 |
-\code{classical_lsq()} ⭢ \code{model()} ⭢ \code{struct_class()} |
|
36 |
+\verb{[classical_lsq]} >> \verb{[model]} >> \verb{[struct_class]} |
|
37 | 37 |
} |
38 | 38 |
|
39 | 39 |
\examples{ |
- get_description moved to struct and updated
... | ... |
@@ -7,13 +7,13 @@ |
7 | 7 |
classical_lsq(alpha = 0.05, mtc = "fdr", factor_names, intercept = TRUE, ...) |
8 | 8 |
} |
9 | 9 |
\arguments{ |
10 |
-\item{alpha}{(numeric) The p-value cutoff for determining significance. The default is \code{0.05}.} |
|
10 |
+\item{alpha}{(numeric) The p-value cutoff for determining significance. The default is \code{0.05}.\cr} |
|
11 | 11 |
|
12 |
-\item{mtc}{(character) Multiple test correction method. Allowed values are limited to the following: \itemize{\item{\code{"bonferroni"}: Bonferroni correction in which the p-values are multiplied by the number of comparisons.}\item{\code{"fdr"}: Benjamini and Hochberg False Discovery Rate correction.}\item{\code{"none"}: No correction.}} The default is \code{"fdr"}.} |
|
12 |
+\item{mtc}{(character) Multiple test correction method. Allowed values are limited to the following: \itemize{ \item{\code{"bonferroni"}: Bonferroni correction in which the p-values are multiplied by the number of comparisons.}\item{\code{"fdr"}: Benjamini and Hochberg False Discovery Rate correction.}\item{\code{"none"}: No correction.}} The default is \code{"fdr"}.} |
|
13 | 13 |
|
14 | 14 |
\item{factor_names}{(character, list) The column names to regress against. If a character vector then the same list is used ofr all features. If a list of character vectors is provided it is assumed there is a different set of columns for each feature.} |
15 | 15 |
|
16 |
-\item{intercept}{(logical) Model intercept. Allowed values are limited to the following: \itemize{\item{\code{"TRUE"}: An intercept term is included in the model.}\item{\code{"FALSE"}: An intercept term is not included in the model.}} The default is \code{TRUE}.} |
|
16 |
+\item{intercept}{(logical) Model intercept. Allowed values are limited to the following: \itemize{ \item{\code{"TRUE"}: An intercept term is included in the model.}\item{\code{"FALSE"}: An intercept term is not included in the model.}} The default is \code{TRUE}.\cr} |
|
17 | 17 |
|
18 | 18 |
\item{...}{Additional slots and values passed to \code{struct_class}.} |
19 | 19 |
} |
... | ... |
@@ -30,7 +30,19 @@ A \code{classical_lsq} object with the following \code{output} slots: |
30 | 30 |
\description{ |
31 | 31 |
In univariate classical least squares regression a line is fitted between each feature/variable and a response variable. The fitted line minimises the sum of squared differences between the true response and the predicted response. The coefficients (offset, gradient) of the fit can be tested for significance. |
32 | 32 |
} |
33 |
+\section{Inheritance}{ |
|
34 |
+ |
|
35 |
+A \code{classical_lsq} object inherits the following \code{struct} classes: \cr\cr |
|
36 |
+\code{classical_lsq()} ⭢ \code{model()} ⭢ \code{struct_class()} |
|
37 |
+} |
|
38 |
+ |
|
33 | 39 |
\examples{ |
40 |
+M = classical_lsq( |
|
41 |
+ alpha = 0.05, |
|
42 |
+ mtc = "fdr", |
|
43 |
+ factor_names = "V1", |
|
44 |
+ intercept = FALSE) |
|
45 |
+ |
|
34 | 46 |
D = iris_DatasetExperiment() |
35 | 47 |
M = classical_lsq(factor_names = 'Species') |
36 | 48 |
M = model_apply(M,D) |
* add selectivity ratio
* replace vip_summary with feature_importance
renamed and now allows vip, sr and sr_pvalues to be plotted
* add equal_split model
random subsets so generate training sets with equal group numbers
* plot 1 - p-value
to conform with the "best" feature being a maximum value
* add resample iterator
subsample at random over a number of iterations. Option to use
different kinds of splitting methods. Corresponding chart.
* allow use of list() for factor_name
* force apply not to simplify output to guarantee returning a list
* update example
* add correct parameter
collect will collect the requested model output over all iterations in a list WORK IN PROGRESS
* add collection of multiple outputs of model sequence
* plot reg coeff on rhs
* match outputs of xval for use with grid search etc
* specify levels when converting predictions to factor
* change PLSDA to inherit from PLSR
rename some charts to be compatible with both PLSR and PLSDA
* allow y-block column selection
* re-assign y output after PLSR with factor
* update vignettes wrt PLS changes
* update documentation
* update R version to 4.1
* update documentation
* update documentation
* update scatter plot
- new scatter chart object
- used by PCA scores, PLSR/PLSDA scores
- other charts updated to reflect changes in scores plots where necessary
- added ycol param to plots for when y-block is a matrix
* add url to github
* add plsda scores alias
- plsda_scores_plot and pls_scores_plot do that same thing
Included for backwards compatability
- added components back as parameter for scores plots for backwards compatibility
* fix broken example
* fix broken tests
- scores is now returned as a DatasetExperiment object not a data.frame
* Update data_analysis_omics_using_the_structtoolbox.Rmd
- wrt changes in scores plots
* update documentation
* fix colnames for Y matrix
... | ... |
@@ -11,7 +11,7 @@ classical_lsq(alpha = 0.05, mtc = "fdr", factor_names, intercept = TRUE, ...) |
11 | 11 |
|
12 | 12 |
\item{mtc}{(character) Multiple test correction method. Allowed values are limited to the following: \itemize{\item{\code{"bonferroni"}: Bonferroni correction in which the p-values are multiplied by the number of comparisons.}\item{\code{"fdr"}: Benjamini and Hochberg False Discovery Rate correction.}\item{\code{"none"}: No correction.}} The default is \code{"fdr"}.} |
13 | 13 |
|
14 |
-\item{factor_names}{(character) The name of sample meta column(s) to use.} |
|
14 |
+\item{factor_names}{(character, list) The column names to regress against. If a character vector then the same list is used ofr all features. If a list of character vectors is provided it is assumed there is a different set of columns for each feature.} |
|
15 | 15 |
|
16 | 16 |
\item{intercept}{(logical) Model intercept. Allowed values are limited to the following: \itemize{\item{\code{"TRUE"}: An intercept term is included in the model.}\item{\code{"FALSE"}: An intercept term is not included in the model.}} The default is \code{TRUE}.} |
17 | 17 |
|
... | ... |
@@ -18,7 +18,14 @@ classical_lsq(alpha = 0.05, mtc = "fdr", factor_names, intercept = TRUE, ...) |
18 | 18 |
\item{...}{Additional slots and values passed to \code{struct_class}.} |
19 | 19 |
} |
20 | 20 |
\value{ |
21 |
-A \code{classical_lsq} object. |
|
21 |
+A \code{classical_lsq} object with the following \code{output} slots: |
|
22 |
+\tabular{ll}{ |
|
23 |
+\code{coefficients} \tab (data.frame) The regression coefficients for each term in the model. \cr |
|
24 |
+\code{p_value} \tab (data.frame) The probability of observing the calculated statistic if the null hypothesis is true. \cr |
|
25 |
+\code{significant} \tab (data.frame) True/False indicating whether the p-value computed for each variable is less than the threshold. \cr |
|
26 |
+\code{r_squared} \tab (data.frame) The value of R Squared for the fitted model. \cr |
|
27 |
+\code{adj_r_squared} \tab (data.frame) The value ofAdjusted R Squared for the fitted model. \cr |
|
28 |
+} |
|
22 | 29 |
} |
23 | 30 |
\description{ |
24 | 31 |
In univariate classical least squares regression a line is fitted between each feature/variable and a response variable. The fitted line minimises the sum of squared differences between the true response and the predicted response. The coefficients (offset, gradient) of the fit can be tested for significance. |
* fix base=10 regardless of input (see #15)
class constructor was always setting base to 10 instead of the input value
* merge bug fix 1.01 into dev (#19)
* bug fix issue #7
Correctly re-order the sample_meta column for colouring samples in the dendrogram plot
* version bump
bug fix issue #7
* fix for https://github.com/computational-metabolomics/structToolbox/issues/18 (#20)
correctly reorder the factor labels so that the control group always ends up in the denominator for the fold change calculation.
* fix for https://github.com/computational-metabolomics/structToolbox/issues/18
fixed incorrect length check on matching class labels.
* Issue 17 ttest factor (#21)
* convert to factor if not one already
fix for issue #17
* update roxygen version
* fix for issue #9 (#22)
changed from lapply to vapply and used drop=FALSE to ensure compatibility with a single factor.
* allow user to set lambda (#24)
- lambda changed to input parameter. NULL = uses pmp optimisation
- model_predict now uses the set value of lambda, or lambda_opt if used.
- documentation updated
* Feature non parametric fold change (#26)
* add "median" method
based on DOI: 10.1080/00949650212140 can now calcuate fold changes equivalent to using medians and corresponding confidence intervals
* update documentation
* update median method
now correctly calculates ratio of medians
* use wilcox for paired median intervals
make use of wilcox.test to estimate intervals for the median when using median for paired samples
* Issue 23 filter by name (#27)
* fix for #23
moved all model_apply functionality to model_predict so that model_train and model_predict can be used as well as model_apply
* update documentation
* Update mean_of_medians.R (#29)
fix for #28
- correctly loop over all levels in the named factor
* Feature documentation 3 12 (#31)
* update documentation
Description and inputs now pulled from the object definitions for consistency.
* fix definition of label_features
allows NULL and description updated
* replace non ascii characters
* export mixed_effect object
* use correct object name to generate documentation
* export mixed_effect object
* remove non ascii characters
* update tests with new object name
* add import for capture.output
* add import for capture.output
* use pca_biplot in tests
chart was renamed
* add utils import
* update struct dependency version
* update documentation
* update news, version bump
... | ... |
@@ -2,35 +2,29 @@ |
2 | 2 |
% Please edit documentation in R/classical_lsq_class.R |
3 | 3 |
\name{classical_lsq} |
4 | 4 |
\alias{classical_lsq} |
5 |
-\title{Classical Least Squares regression} |
|
5 |
+\title{Univariate Classical Least Squares Regression} |
|
6 | 6 |
\usage{ |
7 | 7 |
classical_lsq(alpha = 0.05, mtc = "fdr", factor_names, intercept = TRUE, ...) |
8 | 8 |
} |
9 | 9 |
\arguments{ |
10 |
-\item{alpha}{p-value threshold for determining significance. Default alpha = 0.05.} |
|
10 |
+\item{alpha}{(numeric) The p-value cutoff for determining significance. The default is \code{0.05}.} |
|
11 | 11 |
|
12 |
-\item{mtc}{multiple test correction method to apply. Can be: holm, hochberg, hommel, bonferroni, BH, BY, fdr or none} |
|
12 |
+\item{mtc}{(character) Multiple test correction method. Allowed values are limited to the following: \itemize{\item{\code{"bonferroni"}: Bonferroni correction in which the p-values are multiplied by the number of comparisons.}\item{\code{"fdr"}: Benjamini and Hochberg False Discovery Rate correction.}\item{\code{"none"}: No correction.}} The default is \code{"fdr"}.} |
|
13 | 13 |
|
14 |
-\item{factor_names}{the column name(s) of sample_meta to use} |
|
14 |
+\item{factor_names}{(character) The name of sample meta column(s) to use.} |
|
15 | 15 |
|
16 |
-\item{intercept}{[TRUE] or FALSE to include an intercept term in the fit} |
|
16 |
+\item{intercept}{(logical) Model intercept. Allowed values are limited to the following: \itemize{\item{\code{"TRUE"}: An intercept term is included in the model.}\item{\code{"FALSE"}: An intercept term is not included in the model.}} The default is \code{TRUE}.} |
|
17 | 17 |
|
18 |
-\item{...}{additional slots and values passed to struct_class} |
|
18 |
+\item{...}{Additional slots and values passed to \code{struct_class}.} |
|
19 | 19 |
} |
20 | 20 |
\value{ |
21 |
-A STRUCT method object with functions for applying classical least squares |
|
22 |
- |
|
23 |
-struct object |
|
21 |
+A \code{classical_lsq} object. |
|
24 | 22 |
} |
25 | 23 |
\description{ |
26 |
-Classical least squares, where y is the response and X is the design matrix, |
|
27 |
-applied to each feature individually. Here the response is taken from the |
|
28 |
-data matrix and the design matrix is the taken from the specified sample meta |
|
29 |
-data column. |
|
24 |
+In univariate classical least squares regression a line is fitted between each feature/variable and a response variable. The fitted line minimises the sum of squared differences between the true response and the predicted response. The coefficients (offset, gradient) of the fit can be tested for significance. |
|
30 | 25 |
} |
31 | 26 |
\examples{ |
32 | 27 |
D = iris_DatasetExperiment() |
33 | 28 |
M = classical_lsq(factor_names = 'Species') |
34 | 29 |
M = model_apply(M,D) |
35 |
- |
|
36 | 30 |
} |
... | ... |
@@ -4,10 +4,18 @@ |
4 | 4 |
\alias{classical_lsq} |
5 | 5 |
\title{Classical Least Squares regression} |
6 | 6 |
\usage{ |
7 |
-classical_lsq(...) |
|
7 |
+classical_lsq(alpha = 0.05, mtc = "fdr", factor_names, intercept = TRUE, ...) |
|
8 | 8 |
} |
9 | 9 |
\arguments{ |
10 |
-\item{...}{slots and values for the new object} |
|
10 |
+\item{alpha}{p-value threshold for determining significance. Default alpha = 0.05.} |
|
11 |
+ |
|
12 |
+\item{mtc}{multiple test correction method to apply. Can be: holm, hochberg, hommel, bonferroni, BH, BY, fdr or none} |
|
13 |
+ |
|
14 |
+\item{factor_names}{the column name(s) of sample_meta to use} |
|
15 |
+ |
|
16 |
+\item{intercept}{[TRUE] or FALSE to include an intercept term in the fit} |
|
17 |
+ |
|
18 |
+\item{...}{additional slots and values passed to struct_class} |
|
11 | 19 |
} |
12 | 20 |
\value{ |
13 | 21 |
A STRUCT method object with functions for applying classical least squares |
... | ... |
@@ -20,18 +28,6 @@ applied to each feature individually. Here the response is taken from the |
20 | 28 |
data matrix and the design matrix is the taken from the specified sample meta |
21 | 29 |
data column. |
22 | 30 |
} |
23 |
-\section{Slots}{ |
|
24 |
- |
|
25 |
-\describe{ |
|
26 |
-\item{\code{alpha}}{p-value threshold for determining significance. Default alpha = 0.05.} |
|
27 |
- |
|
28 |
-\item{\code{mtc}}{multiple test correction method to apply. Can be: holm, hochberg, hommel, bonferroni, BH, BY, fdr or none} |
|
29 |
- |
|
30 |
-\item{\code{factor_names}}{the column name(s) of sample_meta to use} |
|
31 |
- |
|
32 |
-\item{\code{intercept}}{[TRUE] or FALSE to include an intercept term in the fit} |
|
33 |
-}} |
|
34 |
- |
|
35 | 31 |
\examples{ |
36 | 32 |
D = iris_DatasetExperiment() |
37 | 33 |
M = classical_lsq(factor_names = 'Species') |
...update some documentation
... | ... |
@@ -7,13 +7,7 @@ |
7 | 7 |
classical_lsq(...) |
8 | 8 |
} |
9 | 9 |
\arguments{ |
10 |
-\item{alpha}{p-value threshold for determining significance. Default alpha = 0.05.} |
|
11 |
- |
|
12 |
-\item{mtc}{multiple test correction method to apply. Can be: holm, hochberg, hommel, bonferroni, BH, BY, fdr or none} |
|
13 |
- |
|
14 |
-\item{factor_names}{the column name(s) of sample_meta to use} |
|
15 |
- |
|
16 |
-\item{intercept}{[TRUE] or FALSE to include an intercept term in the fit} |
|
10 |
+\item{...}{slots and values for the new object} |
|
17 | 11 |
} |
18 | 12 |
\value{ |
19 | 13 |
A STRUCT method object with functions for applying classical least squares |
... | ... |
@@ -24,6 +18,18 @@ applied to each feature individually. Here the response is taken from the |
24 | 18 |
data matrix and the design matrix is the taken from the specified sample meta |
25 | 19 |
data column. |
26 | 20 |
} |
21 |
+\section{Slots}{ |
|
22 |
+ |
|
23 |
+\describe{ |
|
24 |
+\item{\code{alpha}}{p-value threshold for determining significance. Default alpha = 0.05.} |
|
25 |
+ |
|
26 |
+\item{\code{mtc}}{multiple test correction method to apply. Can be: holm, hochberg, hommel, bonferroni, BH, BY, fdr or none} |
|
27 |
+ |
|
28 |
+\item{\code{factor_names}}{the column name(s) of sample_meta to use} |
|
29 |
+ |
|
30 |
+\item{\code{intercept}}{[TRUE] or FALSE to include an intercept term in the fit} |
|
31 |
+}} |
|
32 |
+ |
|
27 | 33 |
\examples{ |
28 | 34 |
D = iris_DatasetExperiment() |
29 | 35 |
M = classical_lsq(factor_names = 'Species') |
...rename all function with dot to underscore
replace dataset with DatasetExperiment
1 | 1 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,32 @@ |
1 |
+% Generated by roxygen2: do not edit by hand |
|
2 |
+% Please edit documentation in R/classical_lsq_class.R |
|
3 |
+\name{classical_lsq} |
|
4 |
+\alias{classical_lsq} |
|
5 |
+\title{Classical Least Squares regression} |
|
6 |
+\usage{ |
|
7 |
+classical_lsq(...) |
|
8 |
+} |
|
9 |
+\arguments{ |
|
10 |
+\item{alpha}{p-value threshold for determining significance. Default alpha = 0.05.} |
|
11 |
+ |
|
12 |
+\item{mtc}{multiple test correction method to apply. Can be: holm, hochberg, hommel, bonferroni, BH, BY, fdr or none} |
|
13 |
+ |
|
14 |
+\item{factor_names}{the column name(s) of sample_meta to use} |
|
15 |
+ |
|
16 |
+\item{intercept}{[TRUE] or FALSE to include an intercept term in the fit} |
|
17 |
+} |
|
18 |
+\value{ |
|
19 |
+A STRUCT method object with functions for applying classical least squares |
|
20 |
+} |
|
21 |
+\description{ |
|
22 |
+Classical least squares, where y is the response and X is the design matrix, |
|
23 |
+applied to each feature individually. Here the response is taken from the |
|
24 |
+data matrix and the design matrix is the taken from the specified sample meta |
|
25 |
+data column. |
|
26 |
+} |
|
27 |
+\examples{ |
|
28 |
+D = iris_DatasetExperiment() |
|
29 |
+M = classical_lsq(factor_names = 'Species') |
|
30 |
+M = model_apply(M,D) |
|
31 |
+ |
|
32 |
+} |