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

monoreg.rowwise

Monotone Regression for Rows or Columns in a Matrix


Description

Monotone (isotone) regression for rows (monoreg.rowwise) or columns (monoreg.colwise) in a matrix.

Usage

monoreg.rowwise(yM, wM)

monoreg.colwise(yM, wM)

Arguments

yM

Matrix with dependent variable for the regression. Values are assumed to be sorted.

wM

Matrix with weights for every entry in the yM matrix.

Value

Matrix with fitted values

Note

This function is used for fitting the ISOP model (see isop.dich).

Author(s)

Alexander Robitzsch

The monoreg function from the fdrtool package is simply extended to handle matrix input.

See Also

See also the monoreg function from the fdrtool package.

Examples

y <- c(22.5, 23.33, 20.83, 24.25 )
w <- c( 3,3,3,2)
# define matrix input
yM <- matrix( 0, nrow=2, ncol=4 )
wM <- yM
yM[1,] <- yM[2,] <- y
wM[1,] <- w
wM[2,] <- c(1,3,4, 3 )

# fit rowwise monotone regression
monoreg.rowwise( yM, wM )
# compare results with monoreg function from fdrtool package
## Not run: 
miceadds::library_install("fdrtool")
fdrtool::monoreg(x=yM[1,], w=wM[1,])$yf
fdrtool::monoreg(x=yM[2,], w=wM[2,])$yf

## End(Not run)

sirt

Supplementary Item Response Theory Models

v3.10-118
GPL (>= 2)
Authors
Alexander Robitzsch [aut,cre] (<https://orcid.org/0000-0002-8226-3132>)
Initial release
2021-09-22 17:45:34

We don't support your browser anymore

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