[R] Help on glm and optim

2010-09-02 Thread Zhang,Yanwei
Dear all, I'm trying to use the optim function to replicate the results from the glm using an example from the help page of glm, but I could not get the optim function to work. Would you please point out where I did wrong? Thanks a lot. The following is the code: # Step 1: fit the glm

Re: [R] Help on glm and optim

2010-09-02 Thread Thomas Lumley
On Thu, 2 Sep 2010, Zhang,Yanwei wrote: Dear all, I'm trying to use the optim function to replicate the results from the glm using an example from the help page of glm, but I could not get the optim function to work. Would you please point out where I did wrong? Thanks a lot. The following

Re: [R] Help on glm and optim

2010-09-02 Thread Zhang,Yanwei
Thomas, Thanks a lot. This solves my problem. Wayne (Yanwei) Zhang Statistical Research CNA -Original Message- From: Thomas Lumley [mailto:tlum...@u.washington.edu] Sent: Thursday, September 02, 2010 11:24 AM To: Zhang,Yanwei Cc: r-help@r-project.org Subject: Re: [R] Help on glm