我使用lm函数在R中运行了回归模型.得到的ANOVA表给出了每个系数的F值(这对我来说真的没有意义).我想知道的是每个系数的t-stat及其相应的p值.我怎么得到这个?它是由函数存储还是需要额外的计算?
这是代码和输出:
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 …
Run Code Online (Sandbox Code Playgroud) 我有3个数据帧我想在大熊猫中合并.一个是20列,另外两个每列有2列.他们是这样组织的:
eth_price.head(n=3)
Out[6]:
time eth_price
0 8/28/17 16:19 344.021
2 8/28/17 16:24 343.833
3 8/28/17 16:29 343.643
btc_price.head(n=3)
Out[7]:
time btc_price
0 2017-08-27 22:50:00 4,389.6113
1 2017-08-27 22:51:00 4,389.0850
2 2017-08-27 22:52:00 4,388.8625
block_data.head(n=3)
Out[8]:
time block_size difficulty estimated_btc_sent \
0 2017-08-30 22:55:03 165261989 888171856257 22433058065308
5 2017-08-30 23:02:03 165261989 888171856257 22433058065308
12 2017-08-30 23:09:03 164262692 888171856257 22210602766312
estimated_transaction_volume_usd hash_rate market_price_usd \
0 1.030796e+09 7.417412e+09 4594.98
5 1.030796e+09 7.417412e+09 4594.98
12 1.020574e+09 7.373261e+09 4594.98
miners_revenue_btc miners_revenue_usd minutes_between_blocks \
0 2495 …
Run Code Online (Sandbox Code Playgroud) 我在pandas中有一个数据框,其组织如下:
btc_price['btc_price'] = pd.to_numeric(btc_price['btc_price'].str.replace(',', ''))
btc_price.head(n=120)
Out[4]:
btc_price
time
2017-08-27 22:50:00 4,389.6113
2017-08-27 22:51:00 4,389.0850
2017-08-27 22:52:00 4,388.8625
2017-08-27 22:53:00 4,389.7888
2017-08-27 22:56:00 4,389.9138
2017-08-27 22:57:00 4,390.1663
2017-08-27 22:58:00 4,390.2600
2017-08-27 22:59:00 4,392.4013
2017-08-27 23:00:00 4,391.6588
2017-08-27 23:01:00 4,391.9213
2017-08-27 23:02:00 4,394.0113
2017-08-27 23:03:00 4,396.9713
2017-08-27 23:04:00 4,397.3350
2017-08-27 23:05:00 4,397.0700
2017-08-27 23:06:00 4,398.6188
2017-08-27 23:07:00 4,398.5725
2017-08-27 23:08:00 4,397.4713
2017-08-27 23:09:00 4,398.0938
2017-08-27 23:10:00 4,398.7775
2017-08-27 23:11:00 4,398.0200
2017-08-27 23:12:00 4,397.9513
2017-08-27 23:13:00 4,398.0613
2017-08-27 23:14:00 4,398.0900
2017-08-27 23:15:00 …
Run Code Online (Sandbox Code Playgroud)