R:在htmlreg()的输出中使用希腊字母作为系数名称

R:在htmlreg()的输出中使用希腊字母作为系数名称,r,texreg,R,Texreg,我想用HTMLreg构建一个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

我想用HTMLreg构建一个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)
种子集(20)

q我假设您正在使用
texreg

\beta
的HTML代码与LaTeX中的不同

htmlreg(list(lin,quad,cub), custom.model.names = c("Linear","Quadratic","Cubic"), 
        custom.coef.names = c("const",
                              "&Beta;<sub>1</sub>",
                              "&Beta;<sub>2</sub>",
                              "&Beta;<sub>3</sub>"))
htmlreg(列表(lin、QUARD、cub),custom.model.names=c(“线性”、“二次”、“三次”),
custom.coef.names=c(“常量”,
“&Beta;1”,
“&Beta;2”,
“&Beta;3”))