Skip to content

Instantly share code, notes, and snippets.

rho chisq p
female 0.0165 0.204 6.52e-01
age -0.0498 1.890 1.69e-01
coupon -0.2450 44.488 2.56e-11
GLOBAL NA 46.461 4.53e-10
# Load the survival library
library(survival)
# Read in the data and create a "survival object"
netlixx_rmst <- read.csv('C:/Users/dayne/Desktop/NetLixxRMST.csv')
netlixx_rmst$survival <- Surv(netlixx_rmst$time, netlixx_rmst$churned == 1)
# Fit a survival curve for each group
Call: survfit(formula = survival ~ credit, data = netlixx_rmst)
records n.max n.start events *rmean *se(rmean) median 0.95LCL 0.95UCL
credit=0 699 699 699 215 123 2.85 142 126 163
credit=1 784 784 784 72 163 1.82 NA NA NA
* restricted mean with upper limit = 180
credit churned time
1 0 173
1 0 75
1 0 75
0 0 36
1 0 29
# Load the pseudo library
library(pseudo)
# Read in the data
netlixx_pseudo <- read.csv('C:/Users/dbatten/Desktop/NetLixxCox.csv')
# Create pseudo observations using 365-day RMST
# Load the geepack library
library(geepack)
# Add an ID to each observation, since it's required by the geese function
n <- length(netlixx_pseudo$time)
netlixx_pseudo <- data.frame(netlixx_pseudo, id = 1:n)
Call:
geese(formula = pseudos ~ female + age + coupon, id = id, data = netlixx_pseudo,
family = gaussian, scale.fix = FALSE, corstr = "independence",
jack = TRUE)
Mean Model:
Mean Link: identity
Variance to Mean Relation: gaussian
Coefficients:
<?php
/* HTML Query String Parameters */
$options = array
(
'street' => '1600 Pennsylvania Avenue Northwest',
'city' => 'Washington',
'state' => 'DC',
'zip' => '20500',
'benchmark' => 'Public_AR_Current',
Array
(
[result] => Array
(
[input] => Array
(
[address] => Array
(
[street] => 1600 Pennsylvania Avenue Northwest
[city] => Washington
1,1600 Pennsylvania Avenue Northwest,Washington,DC,20500
2,129 West 81st Street,New York,NY,10024
3,200 North Blount Street,Raleigh,NC,27601