Skip to content

R package for easily converting various existing r model to latex code (In developing).

Notifications You must be signed in to change notification settings

SecantZhang/rmodel2tex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rmodel2tex

R package for easily converting various existing r model to latex code and pictures. (In developing)

Idea

The idea comes from the final project of my regression class (STAT 462), where our dataset contains more than 60 predictors, and we have to fit 24 of them to the regression model. When completing the presentation as well as the report, we felt it was so annoying and boring for translating the model to latex code by hand because we did so much typing, copying, and pasting. Therefore, I developed this simple r package afterward to do all the work by one line of simple code.

Current Development Objective

  • Create the function for converting the logistic regression and robust regression to latex syntax.
  • Add some simple examples for demo purposes.

Features

Linear Model:

  • Treat the normal, categorical predictors and interaction differently.

Installing

If you're using r studio, follow the code below to install this package.

install.packages("devtools")
library(devtools)
devtools::install_github("SecantZhang/rmodel2tex")
library(rmodel2tex)

Current Supported Model

Name Description Primary Function Code in this package
Linear Models Linear regression lm( ) lm2tex(model, type, round_num)
Logistic Regression Model Logistic Regression glm( ) glm2tex(glm_model, glm_type, glm_form, glm_round_num)

Simple Documentation and Examples

For linear model:

lm2tex(model, type, round_num)

  • model: The model generated by lm() function.
  • type: Whether you want the latex syntax for population model, fitted model or both.
    • "fit": Fitted model
    • "pop": Population model
    • "both": Both fitted and population model.
  • round_num: Number of siginificant digits for the predictor coefficients.

About

R package for easily converting various existing r model to latex code (In developing).

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages