天道酬勤,学无止境

quantile-regression

有没有一种简洁的方法可以用 geom_quantile() 中的方程和其他统计数据来标记 ggplot 图?(Is there a neat approach to label a ggplot plot with the equation and other statistics from geom_quantile()?)

问题 我想以与geom_smooth(method="lm")拟合线性回归类似的方式包含来自geom_quantile()拟合线的相关统计数据(我之前使用过ggpmisc非常棒)。 例如,这段代码: # quantile regression example with ggpmisc equation # basic quantile code from here: # https://ggplot2.tidyverse.org/reference/geom_quantile.html library(tidyverse) library(ggpmisc) # see ggpmisc vignette for stat_poly_eq() code below: # https://cran.r-project.org/web/packages/ggpmisc/vignettes/user-guide.html#stat_poly_eq my_formula <- y ~ x #my_formula <- y ~ poly(x, 3, raw = TRUE) # linear ols regression with equation labelled m <- ggplot(mpg, aes(displ, 1 / hwy)) + geom_point() m + geom

2022-02-08 07:25:36    分类:技术分享    r   ggplot2   label   quantile-regression   ggpmisc

Is there a neat approach to label a ggplot plot with the equation and other statistics from geom_quantile()?

I'd like to include the relevant statistics from a geom_quantile() fitted line in a similar way to how I would for a geom_smooth(method="lm") fitted linear regression (where I've previously used ggpmisc which is awesome). For example, this code: # quantile regression example with ggpmisc equation # basic quantile code from here: # https://ggplot2.tidyverse.org/reference/geom_quantile.html library(tidyverse) library(ggpmisc) # see ggpmisc vignette for stat_poly_eq() code below: # https://cran.r-project.org/web/packages/ggpmisc/vignettes/user-guide.html#stat_poly_eq my_formula <- y ~ x #my

2022-01-12 11:50:47    分类:问答    r   ggplot2   label   quantile-regression   ggpmisc

R - Setting margins does not work

I estimated a linear regression model by using the quantreg package. I now want to display the results graphically by using the plot() function: plottest = plot(summary(QReg_final), parm=2, main="y",ylab="jjjjj") The result is the following (I can only link the image yet): Example As you can see at the very left, the description of the y-axis is cut off. I then tried to adjust the margin parameters, but it seems to have zero influence on the plot. For example: par(mar=c(10,10,2,2)) When I now run the above mentioned code, it results in the exact same plot. On the other hand, when plotting

2021-08-01 11:56:33    分类:问答    r   plot   quantile-regression

python statsmodels: Difference in output “formula.api” vs. “”regression.quantile_regression"

For the modul statsmodels using python, I would please like to know how differences in calling the same procedures using statsmodels.formula.api versus statsmodels.regression.quantile_regression come about. In particular, I obtain differences in parameter estimates. A minimum working example is attached. #%% Moduls; import numpy as np import pandas as pd import statsmodels.api as sm import statsmodels.formula.api as smf from statsmodels.regression.quantile_regression import QuantReg #%% Load in sample data; data = sm.datasets.engel.load_pandas().data #%% smf-Version; model1 = smf.quantreg

2021-06-28 13:52:11    分类:问答    python   api   statsmodels   quantile-regression