```
#Formula for computing R squared
R2<- function (v1, rv1) {(v1-rv1)/v1} #where v1 is the total variance in the dependent taken from either a model without the interaction or tech4
#Proportion R squared explained by interaction
PropR2 <- function (b3, v1, v2, v3, cv1){
#b3 = coef for the interaction predicting the dependent
#v1 = variance of one of the factors that make up the interaction
#v2 = variance of the other factors that make up the interaction
#v3 = variance of the dependent
#cv1 = covariance between the factors making up the latent interaction
x1= v1*v2 + cv1^2
x2 = x1*b3^2
x2/v3
}
#standadized regression weights for main effects and interaction
#Main effects
B <- function(b,v,v3){
#b = the coef of interest
#v = the coef of the independent you are interested in
# v3 = variance of dependent
x1 = b/(v3^.5)
x1*(v^.5)
}
#standadization for interaction
B3std <- function(b3,v1,v2,v3){
#v1 = variance of one of the factors that make up the interaction
#v2 = variance of the other factors that make up the interaction
#v3 = variance of the dependent
#b3 = coef for the interaction predicting the dependent.
x1 = b3/(v3^.5)
x1*(v1^.5)*(v2^.5)
}
```