Comments (8)
Thanks. I'll reduce the text size again :)
from ctsem.
it's a bit tricky yeah, you can output the tex directly by setting compile=F. But here is how I solved it for some blogdown posts: https://cdriver.netlify.app/post/dtbivariate/
```{r TEX,echo=FALSE,out.width='100%',out.height='100%', fig.align='left'} ctModelLatex(model,textsize = 'small', folder=savedir, filename = 'dtbivariate',open=FALSE) bitmap <- pdftools::pdf_render_page(paste0(savedir,'/dtbivariate.pdf'),dpi=72) png::writePNG(bitmap, paste0(savedir,'/dtbivariate.png'))
knitr::include_graphics(paste0('dtbivariate.png'))
That solution works. (BTW, I couldn't help but mention that it's somewhat blurry on my browser... perhaps svg would be crisper?)
from ctsem.
to output just the equation and not the entire document, use the
equationonly=TRUE
argument.
from ctsem.
Is there any chance that the ctModelLatex()
function could give something that I could copy-paste into a R-Markdown document as opposed to a separate pdf? Perhaps, the way equatiomatic does things? https://datalorax.github.io/equatiomatic/
I really appreciate the Latex functionality, makes interpreting the model a lot more approachable.
from ctsem.
it's a bit tricky yeah, you can output the tex directly by setting compile=F. But here is how I solved it for some blogdown posts:
https://cdriver.netlify.app/post/dtbivariate/
```{r TEX,echo=FALSE,out.width='100%',out.height='100%', fig.align='left'}
ctModelLatex(model,textsize = 'small', folder=savedir,
filename = 'dtbivariate',open=FALSE)
bitmap <- pdftools::pdf_render_page(paste0(savedir,'/dtbivariate.pdf'),dpi=72)
png::writePNG(bitmap, paste0(savedir,'/dtbivariate.png'))
knitr::include_graphics(paste0('dtbivariate.png'))
from ctsem.
I couldn't figure out in 2 minutes what equatiomatic was really doing or how it would help, I gladly accept summaries (or pull requests hah) ;)
from ctsem.
I couldn't figure out in 2 minutes what equatiomatic was really doing or how it would help, I gladly accept summaries (or pull requests hah) ;)
So my understanding is that equatiomatic automatically transforms regression models into the sort of equation forms that you might find in a statistics textbook. So it's quite similar to what happens with ctModelLatex()
.
Although, as far as I can tell, it's different in that the latex it outputs can be directly copy-pasted into a R-markdown file like so:
$$
\begin{aligned}
\operatorname{hamd}_{i} &\sim N \left(\alpha_{j[i]} + \beta_{1j[i]}(\operatorname{time}), \sigma^2 \right) \\
\left(
\begin{array}{c}
\begin{aligned}
&\alpha_{j} \\
&\beta_{1j}
\end{aligned}
\end{array}
\right)
&\sim N \left(
\left(
\begin{array}{c}
\begin{aligned}
&\mu_{\alpha_{j}} \\
&\mu_{\beta_{1j}}
\end{aligned}
\end{array}
\right)
,
\left(
\begin{array}{cc}
\sigma^2_{\alpha_{j}} & \rho_{\alpha_{j}\beta_{1j}} \\
\rho_{\beta_{1j}\alpha_{j}} & \sigma^2_{\beta_{1j}}
\end{array}
\right)
\right)
\text{, for id j = 1,} \dots \text{,J}
\end{aligned}
$$
Whereas, my memory of ctModelLatex was that it's different because ctModelLatex gives you enough latex to generate an entire pdf based on the output itself... Which is a lot to parse through for people who aren't as fluent in latex.
from ctsem.
to output just the equation and not the entire document, use the equationonly=TRUE
argument.
from ctsem.
Related Issues (15)
- R CMD check failure with rstan 2.13.2 HOT 4
- ctstantestfit.rda is causing an installation failure with next StanHeaders HOT 39
- Error when specyfing subjects in ctStanDiscretePars HOT 25
- How can I see the p value HOT 1
- plot.ctStanFit error when plotting posterior densities HOT 3
- ctStanSubjectPars(..., pointest = FALSE) HOT 1
- Problem with ctKalman function HOT 4
- browser() in sgd HOT 4
- unable to update ctsem HOT 6
- Broken Vignette Manual's Citations? HOT 2
- stan_checkdivergences gives error HOT 2
- Infinite Error Printing - sh: findstr: command not found HOT 4
- 32-bit builds of cstem fail on Launchpad HOT 1
- Remove hard coding of ID column HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ctsem.