[英]R: Use greek letters as coefficient names in the output of htmlreg()
我想用 html reg 构建一个 html 表,其中包含数学符号作为自定义系数名称。
一个模拟示例:
library(texreg)
set.seed(20)
q <- seq(from=0, to=20, by=0.1)
y <- 500 + 0.4 * (q-10)^3
noise <- rnorm(length(q), mean=10, sd=80)
noisy.y <- y + noise
lin<-lm(noisy.y ~ q )
quad<-lm(noisy.y ~ q + I(q^2) )
cub<-lm(noisy.y ~ q+ I(q^2) + I(q^3))
htmlreg(list(lin,quad,cub), custom.model.names = c("Linear","Quadratic","Cubic"),
custom.coef.names = c("const","\\&beta_1","\\&beta_2","\\&beta_3"))
我假设您正在使用texreg
包。
\\beta
的 HTML 代码与 LaTeX 中的不同。
htmlreg(list(lin,quad,cub), custom.model.names = c("Linear","Quadratic","Cubic"),
custom.coef.names = c("const",
"Β<sub>1</sub>",
"Β<sub>2</sub>",
"Β<sub>3</sub>"))
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.