Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

linRegrParamAndPVal

Fit linear regression, return parameters and p-values


Description

This function fits a linear regression and returns the parameters, including p-values from Anova. Here the vector 'y' (scalar response or dependent variable, ie the value that should get estimated) will be estimated according to 'dep' (explanatory or independent variable). Alternatively, 'dep' may me a matrix where 1st column will be used as 'dep and the 2nd column as 'y'.

Usage

linRegrParamAndPVal(dep, y = NULL, asVect = TRUE)

Arguments

dep

(numeric vector, matrix or data.frame) explanatory or dependent variable, if matrix or data.frame the 1st column will be used, if 'y'=NULL the 2nd column will be used as 'y'

y

(numeric vector) independent variable (the value that should get estimated based on 'dep')

asVect

(logical) return numeric vector (Intercept, slope, p.intercept, p.slope) or matrix or results

Value

numeric vector (Intercept, slope, p.intercept, p.slope), or if asVect==TRUE as matrix (p.values in 2nd column)

See Also

Examples

linRegrParamAndPVal(c(5,5.1,8,8.2),gl(2,2))

wrMisc

Analyze Experimental High-Throughput (Omics) Data

v1.5.4
GPL-3
Authors
Wolfgang Raffelsberger [aut, cre]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.