GithubHelp home page GithubHelp logo

jisshutools's Introduction

jissutools

Overview

調査実習で使える関数を作ってみました。やる気があれば多項ロジットなどもつくります。

Installation

以下のコードを実行してください

if(!require(remotes)) install.packages("remotes")
remotes::install_github("Kentaro-Kamada/jisshutools")

library(jisshutools)

Usage

  • 2変数のクロス表
# Create a sample data
data <-
  data.frame(
    x = c(rep('A', 50), rep('B', 50)),
    y = c(rep(1:5, 20))
  )

# Create a cross table
result <- data |> jisshu_cross(x, y)

# Save the cross table as an excel file
result$save('hoge.xlsx')
  • 線形回帰・2項ロジスティック回帰
# Create a sample data
data <- tibble::tibble(
  x1 = rnorm(100, mean = 0, sd = 1),
  x2 = rnorm(100, mean = 0, sd = 1),
  y = 0.2 + 0.3*x1 + 0.5*x2 + rnorm(100, mean = 0, sd = 0.1),
  y_bin = rbinom(100, 1, plogis(y))
)

# Create a regression table
# Linear regression
model_lm <- lm(y ~ x1 + x2, data = data)
result_lm <- jisshu_reg(model_lm)

# Logistic regression
model_glm <- glm(y_bin ~ x1 + x2, data = data, family = binomial(link = 'logit'))
result_glm <- jisshu_reg(model_glm)

# Save the regression table as an excel file
result_lm$save('hoge_lm.xlsx')
result_glm$save('hoge_glm.xlsx')

jisshutools's People

Contributors

kentaro-kamada avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.