我对ggplot2非常陌生,我希望用多个散点图和它们各自的回归估计来生成一个图形。但是,我使用的非标准回归方法(例如分位数回归和完全回归)不在method参数列表中,这些参数在geom_smooth()中可用。我有一个适合的模型和相应的数据清单。下面是一个有用的例子。
require(data.table); require(ggplot2)
N <- 1000 # Generate some data
DT <- NULL
models <- list() # list of of fitted models. For simplicity i am using lm in
在TradingView松树脚本中,我想计算:
ATR采用高、低、封闭数据,时间周期为30分钟
ATR 5分钟滚动平均值
在Python中,我这样做:
# Calculate the Average True Range(ATR)
df_indicator['ATR'] = talib.ATR(df_indicator['high'], df_indicator['low'], df_indicator['close'], timeperiod=30)
# Calculate the rolling mean of
read.csv("C:\Users\easy\Desktop\workbook.csv")
我需要估计数据集中国家列表的结构断点,我需要为每个国家存储这些盈亏平衡点,并在循环结束后以表格形式显示这些盈亏平衡点。我的数据集是面板数据,这就是我需要遍历国家的原因。
我估计每个国家在我的国家名单的countrynum变量中的回归。我试图存储每个国家回归估计的盈亏平衡点如下
foreach i in countrynum {
by countrynum, sort: reg y x1 x2 x3 if `i'== countrynum
est store
我不确定我是否做错了什么,或者这是confint函数在R本身中的一个错误,但是我得到了回归估计的置信区间,而回归估计不包含这个估计。
这是reprex
# model (converting all numeric columns in data to z-scores)
mod <-
stats::lm(
formula = cbind(mpg, disp) ~ wt,
data = purrr::modify_if(.x = mtcars, .p = is.numeric, .f = scale)
)
# tidy dataframe
broom::tidy
我正在使用TKinter为我的python应用程序构建一个GUI。
我想添加一个滚动条到主屏幕,因为我有很多数据要显示,但空间非常少。目前,我使用的行:
root=Tk()
root.state("zoomed")
#...rest of the code... (Relevant parts mentioned below:)
root.mainloop()
最大限度地利用可用的屏幕空间,但即使这样也不适合我。
下面是John (Codemy.com的首席执行官)的,我用它添加了一个滚动条:
# Create A Main Frame
main_frame = Fra