GithubHelp home page GithubHelp logo

naim's Introduction

naim

Build Status AppVeyor Build Status codecov

A package that uses numerical analysis iterative methods to find maximum likelihood estimates when closed form solutions cannot be obtained.

Installation

Install naim from GitHub:

devtools::install_github("dchiu911/naim")

Note that you need the devtools package to do this.

Usage

First, load the package the usual way:

library(naim)

At the current version, naim has two functions: NR_logit() and ER_blood().

Given vectors x, n, and y, for the covariates, trials, and successes in a logistic regression setting, the MLE for the intercept and slope computed using the Newton-Raphson method are:

set.seed(1)
x <- rnorm(100, mean = 3, sd = 0.2)
n <- sample(1:100, replace = TRUE)
y <- rbinom(100, size = n, prob = 0.6)
NR_logit(x, y, n)
##   intercept      slope
## 1  0.639122 -0.0694504

Given the number of people with blood type A, B, AB, and O, the frequency of the blood alleles A, B, and O are:

A <- 10
B <- 20
AB <- 30
O <- 40
EM_blood(A, B, AB, O)
##    pA_hat   pB_hat   pO_hat
## 1 0.20833 0.270615 0.521055

Both functions return data.frames with the pertinent information in labelled columns.

Vignette

Further details can be found in the vignette for this package. To view it, run this command in the R console:

browseVignettes("naim")

Once there, you can click on the HTML link to get a nice introduction to naim. The help files can be accessed with ?NR_logit and ?EM_blood for details on function arguments and some examples.

Alternatively, there is a markdown version available in this repository, found here.

naim's People

Contributors

dchiu911 avatar

Watchers

 avatar

naim's Issues

Comments on your reflections

Trying to figure out how to get an overview.md to be produced from the vignette YAML

I recently had the some problem. I found that this YAML, coupled with the new-ish vignette roclet for devtools, causes the intermediate Markdown of my vignette to be produced whenever I document my package:

---
title: "googlesheets Basic Usage"
author: "Joanna Zhao, Jenny Bryan"
date: "`r Sys.Date()`"
output:
  rmarkdown::html_vignette:
    toc: true
    keep_md: true
vignette: >
  %\VignetteIndexEntry{googlesheets Basic Usage}
  %\VignetteEngine{knitr::rmarkdown}
  \usepackage[utf8]{inputenc}

---

My question is whether this workflow would coincide with CRAN guidelines after my modification to the .Rbuildignore file.

Yes I think you're fine on this point. If you've got stuff in .Rbuildignore, it won't make it to CRAN.

There seems to be a lot of repeated information in my documentation

This is good for the user, though presents obvious pitfalls for not contradicting yourself as you edit things.

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.