source('../../Data/data_loaders.R') CXY = load_appendix_lamb_data() N = 337 # number of samples m = 6 # number of predictors # Part (a): # # Extract the coefficients of the full linear model: # As we have a correlation matrix these predictors are centered and normalized (divided by the standard deviation) # XTy = as.matrix( CXY[1:m, m+1] ) XTX = as.matrix( CXY[1:m, 1:m] ) beta_hat = solve( XTX, XTy ) # Extract R^2 for the full model: # # Extract the t-stats for each variable in the full model: # if( ! require("leaps") ){ install.packages("leaps") }