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
# regression models from dalgaard | |
library("ISwR") | |
?thuesen | |
thuesen | |
attach(thuesen) | |
lm(short.velocity~blood.glucose) | |
summary(lm(short.velocity~blood.glucose)) #the median should not be far from zero, and the minimum and maximum should be roughly equal in absolute value | |
plot(blood.glucose,short.velocity) | |
abline(lm(short.velocity~blood.glucose)) |
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
# reading data into R: http://goo.gl/bAUmj | |
library("ISwR") | |
#factors | |
pain <- c(0,3,2,2,1) | |
fpain <- factor(pain,levels=0:3) | |
levels(fpain) <- c("none","mild","medium","severe") | |
fpain |
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
install.packages("ISwR") | |
require("ISwR") | |
x <- rnorm(50) | |
mean(x) | |
sd(x) | |
var(x) | |
median(x) | |
quantile(x) | |
pvec <- seq(0,1,0.1) | |
pvec |