R/mgsem_add_increment.R

Defines functions mgsem_add_increment

## File Name: mgsem_add_increment.R
## File Version: 0.04


mgsem_add_increment <- function(x, h, i1, i2=NULL, symm=FALSE )
{
    x1 <- x
    if (is.vector(x)){
        x1[i1] <- x[i1] + h
    } else {
        x1[i1,i2] <- x[i1,i2] + h
        if (symm & (i1!=i2) & (!is.null(i2)) ){
            x1[i2,i1] <- x1[i2,i1] + h
        }
    }
    return(x1)
}

Try the sirt package in your browser

Any scripts or data that you put into this service are public.

sirt documentation built on Aug. 11, 2023, 5:07 p.m.