search for: model_summ

Displaying 3 results from an estimated 3 matches for "model_summ".

2023 Apr 30
2
NaN response with gam (mgcv library)
...2,0.47,0.52,0.87,0.56,0.71,0.6) x2=c(9,7,5,3,2,1,1,2,8,9,6,3,1,5,6,7,3,1,3,5) x3=c(11,10,13,15,10,9,14,16,18,19,20,9,13,12,14,17,21,19,23,12) ? model=lm(y~x1+x2+x3) model1=gam(y ~ s(x1, bs = 'cr', k = 3) + s(x2, bs = 'cr', k = 3)+ s(x3, bs = 'cr', k = 3)) ? ? #Calculate MSE ?model_summ=summary(model) ?mean(model_summ$residuals^2) ? ? ?#Calculate MSE ?model_summ=summary(model1) ?mean(model_summ$residuals^2) #########################################################
2024 Sep 04
2
Calculation of VCV matrix of estimated coefficient
Hi, I am trying to replicate the R's result for VCV matrix of estimated coefficients from linear model as below data(mtcars) model <- lm(mpg~disp+hp, data=mtcars) model_summ <-summary(model) MSE = mean(model_summ$residuals^2) vcov(model) Now I want to calculate the same thing manually, library(dplyr) X = as.matrix(mtcars[, c('disp', 'hp')] %>% mutate(Intercept = 1)); solve(t(X) %*% X) * MSE Unfortunately they do not match. Could you please hel...
2024 Sep 05
1
Calculation of VCV matrix of estimated coefficient
...On Wed, Sep 4, 2024 at 3:34?PM Daniel Lobo <danielobo9976 at gmail.com> wrote: > > Hi, > > I am trying to replicate the R's result for VCV matrix of estimated > coefficients from linear model as below > > data(mtcars) > model <- lm(mpg~disp+hp, data=mtcars) > model_summ <-summary(model) > MSE = mean(model_summ$residuals^2) > vcov(model) > > Now I want to calculate the same thing manually, > > library(dplyr) > X = as.matrix(mtcars[, c('disp', 'hp')] %>% mutate(Intercept = 1)); > solve(t(X) %*% X) * MSE > > Unfortu...