P-values Significance Not Showed In Stargazer Html Regression Table
I am having trouble with the Notes significance (asterisks) not appearing when using stargazer to format html tables. The result is ok when using latex. Here is my source file 'tes
Solution 1:
Maybe it is a bug as @jaySf said in the comments to the original question. But based on @tmfmnk's answer and htmltools
package I ended with a workaround. This is the updated relevant part of the source file.
```{r res,warning=FALSE,message=FALSE,results='hide'}
library(stargazer)
stargazer(m1,m2,type = 'html',title = 'Models', out = "table1.html")
```
```{r, echo=FALSE}
htmltools::includeHTML("table1.html")
```
Solution 2:
Try adding customized notes using notes
and notes.append
parameters as follows:
stargazer(m1,m2,type='html',notes="<span>***</span>: p<0.01; <span>**</span>: p<0.05; <span>*</span>: p<0.1",notes.append=F)
I originally thought that using backslash to escape *
will work, e.g. notes="\\*\\*\\*: p<0.01; \\*\\*: p<0.05; \\*: p<0.1"
. Unfortunately, it doesn't. I also tried to use the HTML code of *
, i.e. *
, e.g. notes="***: p<0.01; **: p<0.05; *: p<0.1"
. Still it doesn't work.
However, surrounding *
with an HTML tag works. It doesn't have to be <span></span>
. I tried <b></b>
, etc. and they worked.
Post a Comment for "P-values Significance Not Showed In Stargazer Html Regression Table"