### ### ### Part I: Preparing and plotting the data ### ### ### rm(list=ls()) getwd() library(rethinking) library(rstan) library(bbmle) library(nlme) #setwd("pathway") reg_data <- read.table("wg_data.txt", header=T) par(mfrow=c(1,2)) hist(reg_data$lg,xlab="height",main="height") hist(reg_data$lf,xlab="number of tillers",main="number of tillers") par(mfrow=c(1,1)) plot(reg_data$lf,reg_data$lg,pch=16,cex=0.55,xlab="number of tillers",ylab="height") max <- 17 reg_data$x<- reg_data$lf reg_data$x2 <- reg_data$x^2 reg_data$y <- reg_data$lg reg_data$x0 <- na.omit(reg_data$x) ord <- order(reg_data$x0) reg_data <-subset(reg_data,lf