R/innerW.R

Defines functions innerW

# Constructs the adjacency matrix D of the structural model.
innerW <-
function(strucmod, latent){
  D <- matrix(0, ncol=length(latent), nrow=length(latent))
  colnames(D) <- latent             # names of LVs
  rownames(D) <- latent             # names of LVs
  for(i in 1:nrow(strucmod)){
    D[which(latent==strucmod[i,1]), which(latent==strucmod[i,2])] <- 1
  }
  return(D)
}

Try the semPLS package in your browser

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

semPLS documentation built on May 2, 2019, 9:34 a.m.