|
library(RcmdrMisc)
|
|
total_data_simple_per_horse <-
|
|
readXL("/home/daten/Nuertingen/Veröffentlichungen/Innovative behaviour/ms general - open door - tool use - innovation/excel/publication/test_Datenbank_Innov+open_doors_24.07.xlsx",
|
|
rownames=FALSE, header=TRUE, na="", sheet="total_data_simple_per_horse",
|
|
stringsAsFactors=TRUE)
|
|
|
|
total_data_simple_per_horse_1 <-
|
|
readXL("/home/daten/Nuertingen/Veröffentlichungen/Innovative behaviour/ms general - open door - tool use - innovation/excel/publication/test_Datenbank_Innov+open_doors_24.07.xlsx",
|
|
rownames=FALSE, header=TRUE, na="na.omit", sheet="total_data_simple_per_horse",
|
|
stringsAsFactors=FALSE)
|
|
library(XLConnect) #read.xls
|
|
# linux Pfad:
|
|
|
|
setwd('/home/daten/Nuertingen/Veröffentlichungen/Innovative behaviour/ms general - open door - tool use - innovation/excel/publication/') #set path
|
|
# Winows Pfad:
|
|
# setwd('I:\Nuertingen\Veröffentlichungen\Stress Hormone Lokalisation Methode\Excel\') #set path
|
|
|
|
|
|
excelfile<-"test_Datenbank_Innov+open_doors_24.07.xlsx" #change filename
|
|
wb1 <- loadWorkbook(excelfile)
|
|
setMissingValue(wb1, value = "NA")
|
|
total_data_simple_per_horse_2 <- readWorksheet(wb1, sheet = "total_data_simple_per_horse",startRow=1,endRow = 515) #change sheet name
|
|
names(data_all)
|
|
|
|
as.data.frame(total_data_simple_per_horse_2)
|
|
as.numeric(sub(",", ".", total_data_simple_per_horse_2$age, fixed = TRUE))
|
|
|
|
GLM.1 <- glm(behaviour.frequency ~ as.numeric(sub(",", ".", total_data_simple_per_horse_2$age, fixed = TRUE)) + breed
|
|
, family=gaussian(inverse),
|
|
data=total_data_simple_per_horse_1, na.action=na.omit)
|
|
summary(GLM.7)
|
|
total_data_simple_per_horse_2$age
|
|
names(total_data_simple_per_horse_1)
|
|
|
|
# A Gamma example, from McCullagh & Nelder (1989, pp. 300-2)
|
|
clotting <- data.frame(
|
|
u = c(5,10,15,20,30,40,60,80,100),
|
|
lot1 = c(118,58,42,35,27,25,21,19,18),
|
|
lot2 = c(69,35,26,21,18,16,13,12,12))
|
|
summary(glm(lot1 ~ log(u), data = clotting, family = Gamma))
|
|
summary(glm(lot2 ~ log(u), data = clotting, family = Gamma))
|
|
|
|
|
|
clotting <- data.frame(
|
|
u = c(5,10,15,20,30,40,60,80,100),
|
|
lot2 = c("NA",58,42,35,27,25,21,19,18),
|
|
lot1 = c(69,35,26,21,18,16,13,12,12))
|
|
summary(glm(lot1 ~ log(u), data = clotting, family = gaussian, na.action=na.omit))
|
|
summary(glm(lot1 ~ log(u), data = clotting, family = gaussian))
|
|
|
|
|
|
## Not run:
|
|
## for an example of the use of a terms object as a formula
|
|
demo(glm.vr)
|