This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
id | time | event | |
---|---|---|---|
1 | 253 | 0 | |
2 | 385 | 0 | |
3 | 720 | 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
id | sex | tstart | tstop | had_event | contacted_support | |
---|---|---|---|---|---|---|
1 | female | 0 | 253 | 0 | 0 | |
2 | female | 0 | 385 | 0 | 0 | |
3 | male | 0 | 100 | 0 | 0 | |
3 | male | 100 | 720 | 1 | 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
newdata <- tmerge(base, support, id = id, contacted_support = tdc(time, contacted_support)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
base <- tmerge(customer, event, id = id, tstop = time, had_event = event(time, event)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(survival) | |
customer <- read.csv("C:/Users/dbatten/Desktop/customer.csv") | |
event <- read.csv("C:/Users/dbatten/Desktop/event.csv") | |
support <- read.csv("C:/Users/dbatten/Desktop/support.csv") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
id | time | contacted_support | |
---|---|---|---|
1 | 0 | 0 | |
2 | 0 | 0 | |
3 | 0 | 0 | |
3 | 100 | 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
id | sex | |
---|---|---|
1 | female | |
2 | female | |
3 | male |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Add to the list of imports | |
import org.apache.hadoop.mapreduce.lib.input.*; | |
// Add to the fields of the LineRecordReader class | |
private boolean fileBroken; | |
private String splitName; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Licensed to the Apache Software Foundation (ASF) under one | |
* or more contributor license agreements. See the NOTICE file | |
* distributed with this work for additional information | |
* regarding copyright ownership. The ASF licenses this file | |
* to you under the Apache License, Version 2.0 (the | |
* "License"); you may not use this file except in compliance | |
* with the License. You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Function to get hazard ratio for males vs. baseline at any given time | |
y = function(x) exp(-.4667783 - .0008827 * x) | |
# Plot it | |
plot(y, ylim=c(0,1), xlim=c(0,1000), xlab = 'Time', ylab = 'Hazard Ratio') | |
title('Hazard Ratio for Male') |