You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
set.seed(123)
# Number of observationsn<-100# Generate two uncorrelated predictorsx1<- rnorm(n)
x2<- rnorm(n)
# Generate noisenoise<- rnorm(n)
# Generate outcome as a linear combination of the predictors and noisey<-0.5*x1+0.5*x2+noise# Create a data framedata<-data.frame(y=y, x1=x1, x2=x2)
# View the first few rows of the data frame
head(data)
#> y x1 x2#> 1 1.5633692 -0.56047565 -0.71040656#> 2 1.3257661 -0.23017749 0.25688371#> 3 0.3908632 1.55870831 -0.24669188#> 4 0.4046770 0.07050839 -0.34754260#> 5 -0.8255054 0.12928774 -0.95161857#> 6 0.3587717 1.71506499 -0.04502772mod<- lm(data=data, y~x1+x2)
mod|>performance::check_model()
mod|>performance::check_collinearity()
#> # Check for Multicollinearity#> #> Low Correlation#> #> Term VIF VIF 95% CI Increased SE Tolerance Tolerance 95% CI#> x1 1.00 [1.00, Inf] 1.00 1.00 [0.00, 1.00]#> x2 1.00 [1.00, Inf] 1.00 1.00 [0.00, 1.00]
Created on 2023-07-04 with reprex v2.0.2
The text was updated successfully, but these errors were encountered: