Re: [R] Trying to replicate error message in subset()

2007-02-12 Thread Michael Rennie
ect length in: >`==.default`(x1, a) > > new.dat > y1 x1 x2 >30.5977786 A B >62.5470739 A B >90.9128595 A B >12 1.0953531 A D >15 2.4984470 A D >18 1.7289529 A D >61 -0.4848938 D B >6 > >you can do bet

[R] Trying to replicate error message in subset()

2007-02-11 Thread Michael Rennie
ist. Any thoughts on how I can replicate the error? As far as I can tell, the only difference between the case where I am getting errors and the example above is that the levels of x1 in my case are words (i.e., "Smelly", "Howdy"), but strings are strings, aren't they? M

[R] Losing factor levels when moving variables from one context to another

2007-02-01 Thread Michael Rennie
4.752961 3 15 4.445216 3 > I seem to have lost everything I once has associated with "vecs", and it's turned my actual values into arbitrary groupings. I assume this has something to do with the behaviour of factors? Does anyone have any suggestions on how to get my original le

Re: [R] plotting results from tapply; using indexing to incorporate error bars

2007-01-29 Thread Michael Rennie
"blue"), ylim = range(ex.dat$y1))) arrows(1:2,xbar+sem, 1:2,xbar-sem, col = c("red", "blue"), angle=90, code=3, length=.05) #as you can see, though the values for standard errors match the appropriate means, the assignment of colours d

[R] plotting results from tapply

2007-01-26 Thread Michael Rennie
ion where I can specify the inclusion of error bars. Presumably the interaction.plot has figured out how to do what I'm attempting, so I have some faith that I am on the right track Michael Rennie Ph.D. Candidate, University of Toronto at Mississauga 3359 Mississauga Rd. N. Mississauga, O

[R] extracting F, df and r squared using "sapply"?

2005-02-18 Thread Michael Rennie
tion in a tabulated form. and no smart-alec comments about bonferonni corrections :) Thanks, Mike Michael Rennie Ph.D. Candidate University of Toronto at Mississauga 3359 Mississauga Rd. N. Mississauga, ON L5L 1C6 Ph: 905-828-5452 Fax: 905-828-3792 __

[R] Kudos to the R support team

2004-07-29 Thread Michael Rennie
hat you do here. Not only are you providing a service to people who are learning R, but indeed helping increase "R literacy". Soon, they'll be speaking R on the subway. Thank you all, once again. You are all wonderful people. -- Michael Rennie Ph.D. Candidate University of To

[R] extracting the t-statistic: just the numbers, please

2004-07-28 Thread Michael Rennie
Alternatively, can I manipulate the output I am currently getting for the t- statistics so that I can isolate just the numbers? -- Michael Rennie Ph.D. Candidate University of Toronto at Mississauga 3359 Mississauga Rd. N. Mississauga ON L5L 1C6 Ph: 905-828-5452 Fax: 905-828-3792 __

[R] modelling nested random effects with interactions in R

2004-04-01 Thread Michael Rennie
my syntax is off, but does anyone have any suggestions on how to fix it? Unfortunately, the only resources I have available to me at the moment are an "S-plus v. 4. guide to statistics", the archived help files on the R website, an the examples and help files in R. Your help

[R] Testing significance in a design with unequal but proportional sample sizes

2004-03-04 Thread Michael Rennie
found some discussions in the archives revolving around type III sums of squares from 2001, but the lack of consensus around the discussion did little to assure me that I should try this approach. Anyone with advice, code or suggestions, I'd love to hear any of it. Cheers, Mike -- Michael Rennie

Re: [R] Excel can do what R can't?????

2003-07-16 Thread Michael Rennie
; problem would eliminate the need to have all those variables defined in > the global environment (but otherwise it won't change anything). > What's lexical scoping? Mike -- Michael Rennie M.Sc. Candidate University of Toronto at Missis

RE: [R] Excel can do what R can't?????

2003-07-16 Thread Michael Rennie
ver p, ACT, as evidenced that they offer identical solutions for the same values of p, ACT, then shouldn't they be reaching the same solution? AH! Ureka moment- see top of e-mail Thanks again for your suggestions. Mike > > Reid Huntsinger > > -Original Message-

RE: [R] Excel can do what R can't?????

2003-07-16 Thread Michael Rennie
what they do in excel- it's something about how R is examining the possibilities in the optimization process that is giving me different answers between the two. I dunno- I'm going to tinker with it some more tonight. Mike Reid -Original Message- From: Michael Rennie [mail

Re: [R] Excel can do what R can't?????

2003-07-16 Thread Michael Rennie
t; > > . > > fn: A function to be minimized (or maximized), with first > > argument the vector of parameters over which minimization is > > to take place. It should return a scalar result. > > > > Your fn defined as: > > f <- 1

Re: [R] Excel can do what R can't?????

2003-07-15 Thread Michael Rennie
o work. Mike Sorry I can't be more helpful. Jerome On July 15, 2003 10:46 am, Michael Rennie wrote: > Hi there > > I thought this would be of particular interest to people using 'optim' > functions and perhaps people involved with R development. > > I

[R] Excel can do what R can't?????

2003-07-15 Thread Michael Rennie
4.1 318 104 4.2 319 105 4.2 320 106 4.3 321 107 4.3 322 108 4.4 323 109 4.4 324 110 4.5 325 111 4.5 326 112 4.6 327 113 4.7 328 114 4.7 329 115 4.8 330 116 4.9 331 117 5 332 118

Re: [R] problem with coding for 'optim' in R

2003-07-14 Thread Michael Rennie
<-c(p,ACT) > > #specify sttarting values > #q0<-c(p = 1, ACT = 1) > > #introduce function to solve > f <- function (q) + { + + + M<- length(Day) #number of days iterated + + for (i in 1:M) + { + + #Bioenergetics model + + if (Day[i]==1) W[i] <- Wo else + if (j

Re: [R] problem with coding for 'optim' in R

2003-07-14 Thread Michael Rennie
that ignores its parameters. From what I've read and the examples I've encountered, the 'optim' function expects the first entry in optim(x, f, etc) To be the starting point for your variable that you specify earlier in the loop under f<- function (x) If I am wron

[R] problem with coding for 'optim' in R

2003-07-14 Thread Michael Rennie
introduce function to solve > f <- function (q) + { + + M<- length(Day) #number of days iterated + + for (i in 1:M) + { + + #Bioenergetics model + + if (Day[i]==1) W[i] <- Wo else + if (jday[i]==121 && Mat==1) W[i] <- (W[i-1]-(W[i-1]*GSI*1.2)) else + W[i] <- (W[i-1]+(Gr[i

Re: [R] solving multiple parameter starting values in nlm

2003-07-08 Thread Michael Rennie
d "optim" is stalling in the same places and generating the same errors as 'nlm'. Any other thoughts or suggestions for what I'm doing wrong? hope this helps. spencer graves Michael Rennie wrote: Hi there I am having trouble figuring out how to get an nlm function to r

[R] specifying multiple parameter starting values in nlm

2003-07-07 Thread Michael Rennie
t length"- an error I don't get when I run the mass-balance loop outside the nlm function and just specify q, r). Does anyone know how to specify two parameters in the function, and ask for estimates of both back from nlm? Alternatively, any hunches on how to make this thing do what I want

[R] strange error message

2003-07-01 Thread Michael Rennie
U [1,] 9.20 233.6647 107.5640 64.50050 43.06345 31.93755 15.840142 Also, does anyone know why I might be getting differences in the same calculation between R and Excel? Is there any way to keep R from rounding your numbers, or to specify the # of decimal places you want for an el

[R] Creating a loop that works....

2003-06-30 Thread Michael Rennie
FB)*(exp(FG*p))*C) + + U<- (UA*(comp[,2]^UB)*(exp(UG*p))*(C-F)) + + SDA<- (S*(C-F)) + + Gr<- (C-(ASMR+F+U+SDA)) + #Day, Temp, Vc, Vr, W, C, ASMR, SMR, A, F, U, SDA, Gr) + + bio<- rbind(c(W, C, ASMR, SMR, A, F, U, SDA, Gr)) + + dimnames (bio) <-list(NULL, c ("W", "C&q

[R] Constructing loops in which i+1st element depends on ith

2003-06-30 Thread Michael Rennie
MR, A, F, U, SDA, Gr)) dimnames (bio) <-list(NULL, c ("W", "C", "ASMR", "SMR", "A", "F", "U", "SDA", "Gr")) } bio I would be grateful for any suggestions people might have. Thanks, Mike -- Michael

[R] if else statements in R

2003-06-30 Thread Michael Rennie
d stalls in the same spot as the previous version. Does anyone have any hints on how to make this if else statement work to do what I need? This is my first time trying to use these statements, and the S-plus manual i have is proving to be terribly unhelpful. What am I doing wrong? Mike Mi

[R] if else statements in R

2003-06-30 Thread Michael Rennie
d stalls in the same spot as the previous version. Does anyone have any hints on how to make this if else statement work to do what I need? This is my first time trying to use these statements, and the S-plus manual i have is proving to be terribly unhelpful. What am I doing wrong? Mike Mi