Re: [R] Question regarding significance of a covariate in a coxme survival model

2010-08-29 Thread Cheng Peng
The likelihood ratio test is more reliable when one model is nested in the other. This true for your case. AIC/SBC are usually used when two models are in a hiearchical structure. Please also note that any decision made made based on AIC/SBC scores are very subjective since no sampling

Re: [R] Three-dimensional contingency table

2010-08-29 Thread Cheng Peng
I didn't see any error when I ran your code in my computer: numbers - c(1134,956,328,529,435,599,27,99) dim(numbers) - c(2,2,2) numbers , , 1 [,1] [,2] [1,] 1134 328 [2,] 956 529 , , 2 [,1] [,2] [1,] 435 27 [2,] 599 99 dimnames(numbers)[[3]] -list(Mussels, No

Re: [R] Question regarding significance of a covariate in a coxme survival model

2010-08-29 Thread Cheng Peng
My suggestion: If compare model 1 and model 2 with model 0 respectively, the (penalized) likelihood ratio test is valid. IF you compare model 2 with model 3, the (penalized) likelihood ratio test is invalid. You may want to use AIC/SBC to make a subjective decision. -- View this message in

Re: [R] Question regarding significance of a covariate in a coxme survival

2010-08-29 Thread cheng peng
What statistical measure(s) tend to be answering ALL(?) question of practical interest? -- View this message in context: http://r.789695.n4.nabble.com/Re-Question-regarding-significance-of-a-covariate-in-a-coxme-survival-tp2399386p2399524.html Sent from the R help mailing list archive at

Re: [R] expression() and plot title

2010-08-28 Thread Cheng Peng
Try this: LinePlot(1,1) LinePlot=function(a,b){ + # a = slope + # b = y intercept + x=seq(-10,10,0.4) + y=a*x+b + plot(x,y, type=l) + title(paste(a=,a,b=,b)) + } #test LinePlot(a=-2,b=9) HTH -- View this message in context:

Re: [R] How to define new matrix based on an elementary row operation in a single step?

2010-08-28 Thread Cheng Peng
Sorry for possible misunderstanding: I want to define a matrix (B) based on an existing matrix (A) in a single step and keep A unchanged: #Existing matrix A=matrix(1:16,ncol=4) A [,1] [,2] [,3] [,4] [1,]159 13 [2,]26 10 14 [3,]37 11 15 [4,]4

Re: [R] Non-standard sorts on vectors

2010-08-28 Thread Cheng Peng
The following code shows that the unlisted data frame assigns an index to each member. When one sorts the data frame based on ULST, he in fact uses the (implicit) indices of ULST but not the actual values! Therefore, your guess is correct. test.vec=data.frame(c(A,F,C)) ULST=unlist(test.vec)

Re: [R] How to remove all objects except a few specified objects?

2010-08-25 Thread Cheng Peng
Thanks Josh and Karl. function dnrm() works well for my purpose. -- View this message in context: http://r.789695.n4.nabble.com/How-to-remove-all-objects-except-a-few-specified-objects-tp2335651p2337398.html Sent from the R help mailing list archive at Nabble.com.

Re: [R] How to remove all objects except a few specified objects?

2010-08-25 Thread Cheng Peng
Thanks to De-Jian and Peter. Peter's way is neat and cool! -- View this message in context: http://r.789695.n4.nabble.com/How-to-remove-all-objects-except-a-few-specified-objects-tp2335651p2338221.html Sent from the R help mailing list archive at Nabble.com.

Re: [R] What does this warning message (from optim function) mean?

2010-08-25 Thread Cheng Peng
the deteminant is a nonpositive value. log(det(...)) produce NaNs... -- View this message in context: http://r.789695.n4.nabble.com/What-does-this-warning-message-from-optim-function-mean-tp2338689p2338719.html Sent from the R help mailing list archive at Nabble.com.

Re: [R] How to remove all objects except a few specified objects?

2010-08-24 Thread Cheng Peng
Thanks for all suggestions from Roman (?= 500600[via R]), Barry and Jim. It seems that ls()[-objectname] didn't work even on numeric matrices and user made functions. I will work with Jim's advice on using grep() and gc() to see whether it works. -- View this message in context:

[R] How to remove all objects except a few specified objects?

2010-08-23 Thread Cheng Peng
How to remove all R objects in the RAM except for a few specified ones? rm(list=ls()) removes all R objects in the R work space. Another question is that whether removing all R objects actually releases the RAM? Thanks. -- View this message in context: