A4solutionNew.pdf - Assignment 4 solution 1 Linear regression analysis(a Scatter plot and the simple linear regression analysis

A4solutionNew.pdf - Assignment 4 solution 1 Linear...

This preview shows page 1 - 4 out of 9 pages.

Assignment 4 solution 1.Linear regression analysis (a)Scatter plot and the simple linear regression analysis (b)Fit a quadratic model.
2
plot(time,growth) #(i) Logistic model #Initial estimates: max1=max(growth) min1=min(growth) mean1=mean(growth) mean2=mean(time) (a.start=max1) (b.start=a.start/min1 -1) (c.start=-log((a.start-mean1)/(b.start*mean1))/mean2) Fit1=nls(growth~a/(1+b*exp(-c0*time)), start=list(a=a.start,b=b.start,c0=c.start)) summary(Fit1) (Estimates=coef(Fit1)) #estimates of a, b, c0 Est1=Estimates Fitted1=Estimates[1]/(1+Estimates[2]*exp(-Estimates[3]*time)) resid1=growth-Fitted1 lines(time,Fitted1, lty=2, col="blue")

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture