Re: [R] obtaining output from an evaluated expression

2008-12-19 Thread Prof Brian Ripley
On Fri, 19 Dec 2008, Dieter Menne wrote: Jack Bowden mrc-bsu.cam.ac.uk> writes: > dU1dtheta <- deriv(~ xi-(alpha0+alpha1*gi), c("alpha0","alpha1")) > eval(dU1dtheta) (Intercept) -0.2547153 attr(,"gradient") alpha0 alpha1 [1,] -1 0 I want to extract the output gradient values

Re: [R] obtaining output from an evaluated expression

2008-12-19 Thread Dieter Menne
Jack Bowden mrc-bsu.cam.ac.uk> writes: > > dU1dtheta <- deriv(~ xi-(alpha0+alpha1*gi), c("alpha0","alpha1")) > > eval(dU1dtheta) > (Intercept) > -0.2547153 > attr(,"gradient") > alpha0 alpha1 > [1,] -1 0 > > I want to extract the output gradient values of -1 and 0 but I don'

[R] obtaining output from an evaluated expression

2008-12-19 Thread Jack Bowden
Hi I am trying to use the deriv and eval functions to obtain the value of a function , say "xi-(alpha0+alpha1*gi)" , differentiated with respect to alpha0 and alpha1, in the following way # for gi = 0 > dU1dtheta <- deriv(~ xi-(alpha0+alpha1*gi), c("alpha0","alpha1")) > eval(dU1dtheta) (I