Created
October 27, 2014 14:25
-
-
Save bwarren2/a1097ecc7106296afb7c to your computer and use it in GitHub Desktop.
This file contains 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
setwd("~/Downloads") | |
df.lily = read.csv('lily.csv') | |
summary(df.lily) | |
str(df.lily) | |
colnames(df.lily) | |
df.lily$cat = '' | |
df.lily[df.lily$Falling.Asleep.Time==0,]$cat='Put To Sleep' | |
df.lily[df.lily$Falling.Asleep.Time!=0,]$cat='Self To Sleep' | |
library(lattice) | |
densityplot(~df.lily$Nap.Length, groups=df.lily$cat, xlab='Nap Length') | |
# Is the sleeping or waking happening at wildly different times? Nope. Different wake explained by duration. | |
densityplot(~df.lily$Sleep.Hour, groups=df.lily$cat, xlab='Wake Hour') | |
densityplot(~df.lily$Wake.Hour, groups=df.lily$cat, xlab='Wake Hour') | |
#Maybe hacking at the hour is too coarse? No. | |
densityplot(~df.lily$Sleep.Percent.of.Day, groups=df.lily$cat, xlab='Wake Hour') | |
densityplot(~df.lily$Wake.Percent.of.Day, groups=df.lily$cat, xlab='Wake Hour') | |
t.test(df.lily[df.lily$Falling.Asleep.Time==0,]$Nap.Length, df.lily[df.lily$Falling.Asleep.Time!=0,]$Nap.Length, "two.sided", 0, FALSE, TRUE, 0.95) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment