Skip to content

Instantly share code, notes, and snippets.

View sebnyberg's full-sized avatar
🇸🇪

Sebastian Nyberg sebnyberg

🇸🇪
View GitHub Profile
library(ggplot2)
# returns the odds of a model given an input vector x
get_log_odds <- function(model,x) {
n_coeff <- length(model$coefficients)
if (n_coeff - length(x) == 1) {
# user forgot the first 1 in [1, x1,...]
x <- c(1,x)
source('helpers.R')
# ========================================
# ==============[ Q 3.3.1 ]===============
# ========================================
load('hilda.Rdata')
# redefine the hospitaldays to be 1 for anything above 1
# ========================================
# ==============[ Q 3.2.1 ]===============
# ========================================
load('hilda.Rdata')
source('helpers.R')
hilda <- setup_data_base(hilda)
# form the first model by splitting the ages into groups of five
# ========================================
# ==============[ Q 3.1.1 ]===============
# ========================================
# load data
load('hilda.Rdata')
source('helpers.R')
# redifine the hospitaldays to be 1 for anything above 1
hilda$hospdays[(hilda$hospdays >= 1)] = 1
library(ggplot2)
source('helpers.R')
# ======================================
# ==============[ Q 3.4 ]===============
# ======================================
# prepare the model by defining factors
library(ggplot2)
source('helpers.R')
load('data.Rda')
head(data)
####### Setup data
data$crm <- (data$crimes / data$popul) * 1000
data$crm <- ceiling(data$crm)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DataReader.Extensions;
using iTextSharp.text.log;
using iTextSharp.text.pdf;
using iTextSharp.text.pdf.parser;
namespace DataReader.ExploredCode
{
"query": "",
"sort": [
{
"field": "_relevance",
"order": "Descending"
}
],
"fields": [
"variants.subVariant.nutriqty",
@sebnyberg
sebnyberg / introrx.md
Created October 24, 2017 11:47 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing