I have run a regression model in R using the lm function. The resulting ANOVA table gives me the F-value for each coefficient (which doesnt really make sense to me). What I would like to know is the t-stat for each coefficient and its corresponding p-value. How do I get this? Is it stored by the function or does it require additional computation?
Here is the code and output:
library(lubridate)
library(RCurl)
library(plyr)
[in] fit <- lm(btc_close ~ vix_close + gold_close + eth_close, data = all_dat)
# Other useful functions
coefficients(fit) # model coefficients
confint(fit, level=0.95) # CIs for model parameters
anova(fit) # anova table
[out]
Analysis of Variance Table
Response: btc_close
Df Sum Sq Mean Sq F value Pr(>F)
vix_close 1 20911897 20911897 280.1788 <2e-16 ***
gold_close 1 91902 91902 1.2313 0.2698
eth_close 1 42716393 42716393 572.3168 <2e-16 ***
Residuals 99 7389130 74638
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
If my statistics knowledge serves me correctly, these f-values are meaningless. Theoretically, I should receive an F-value for the model and a T-value for each coefficient.
summary(fit)$coefficients[,4] for p-values
summary(fit)$coefficients[,3] for t-values
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With