[R] how to categorize continuous variable when useing regression

2009-09-16 Thread Manli Yan
assume dependent variable y( continuous),independent variable x ( continuous),I try to categorize x with some interval,such that,those intervals would has most significant different effect on y. any one knows which method I should apply,I know it will cause the loss of information,but can

[R] how to categorize continuous variable when useing regression

2009-08-20 Thread Manli Yan
assume dependent variable y( continuous),independent variable x ( continuous),I try to categorize x with some interval,such that,those intervals would has most significant different effect on y. any one knows which method I should apply,I really need some hints,thanks so much~ [[alt

[R] who happenly read these two paper Mohsen Pourahmadi (biometrika1999, 2000)

2009-04-11 Thread Manli Yan
http://biomet.oxfordjournals.org/cgi/reprint/86/3/677 biometrika1999 http://biomet.oxfordjournals.org/cgi/reprint/94/4/1006 biometrika2000 Hi All: I just want to try some luck. I am currenly working on my project,one part of my project is to reanalysis the kenward cattle data by using the m

[R] who happenly read these two paper Mohsen Pourahmadi (biometrika1999, 2000)

2009-04-10 Thread Manli Yan
http://biomet.oxfordjournals.org/cgi/reprint/86/3/677 biometrika1999 http://biomet.oxfordjournals.org/cgi/reprint/94/4/1006 biometrika2000 Hi All: I just want to try some luck. I am currenly working on my project,one part of my project is to reanalysis the kenward cattle data by using the m

Re: [R] Cholesky Decomposition in R

2009-03-11 Thread Manli Yan
triangular factor > D <- diag(D^2) ## and diagonal > ## So now A = LDL' > range(A-L%*%D%*%t(L)) > > #best, > #Simon > > > On Tuesday 10 March 2009 21:33, Manli Yan wrote: > > Hi everyone: > > I try to use r to do the Cholesky Decomposition,which is

[R] anyone can help me with Cholesky Decomposition

2009-03-10 Thread Manli Yan
Hi: what I want to do is decompose the a symmetric matrix A into this form A=LDL' hence TAT'=D,T is inverse of (L)and T is a lower trangular matrix,and D is dignoal matrix for one case A=1 1 1 1 5 5 1 5 14 T=inverse(L)= 1 0 0 -1 1 0 0 -1 1 D=(1,

[R] Cholesky Decomposition in R

2009-03-10 Thread Manli Yan
Hi everyone: I try to use r to do the Cholesky Decomposition,which is A=LDL',so far I only found how to decomposite A in to LL' by using chol(A),the function Cholesky(A) doesnt work,any one know other command to decomposte A in to LDL' My r code is: library(Matrix) A=matrix(c(1,1,1,1,5,5,1,

[R] how to omit NA without using ifelse

2009-03-05 Thread Manli Yan
I have a 50*50 matrix,some entry are NAs,I want to replace these NA by 0,so can I use some syntax to do so other than using ifelse? I tried to use replace(a,NA,0),it didnt work~~(a is matrix name) Thanks~ [[alternative HTML version deleted]] __

[R] how to create many variables at one time?

2009-03-04 Thread Manli Yan
Hi: I need to create many variables at one time,how to do this in R? for eg ,X1,X2...X100? Thanks~ [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read

Re: [R] problem in R for Linear mixed model~

2008-06-22 Thread Manli Yan
t; -Ursprüngliche Nachricht- > Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Im > Auftrag von Manli Yan > Gesendet: Sunday, June 22, 2008 9:30 PM > An: r-help@r-project.org > Betreff: [R] problem in R for Linear mixed model~ > > Dear R users: > I just got confused som

[R] problem in R for Linear mixed model~

2008-06-22 Thread Manli Yan
Dear R users: I just got confused some R code used in linear mixed model~ example,two factors,A, B,C,A is fixed ,B,C are random,and B is nested in C,if I wannt to use linear mixed model,are the following code correct for each case? case1:want to know random effect of B, case1<-lme(y~A*B*C

Re: [R] try to find the MLE of a function

2008-06-19 Thread Manli Yan
g(density), so in your case > it should be > f <-function(theta) -sum(log(theta) + (theta-1)*log(x)) > > and finally you must specify a start value, i.e. your call should be > mle(f,start=list(thetha=1)) > > > --- On Thu, 19/6/08, Manli Yan <[EMAIL PROTECTED]> wrote: &g

[R] try to find the MLE of a function

2008-06-18 Thread Manli Yan
Hi everyone: I have a density function f(x|theta)=theta*x^(theta-1),where 00 in my function. Great thanks for your time~ [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-h

[R] multiple multiplication in R

2008-06-18 Thread Manli Yan
hi: just a very simple quesion,how to do multiple multiplication in R x<-c(1,2,3,4,5,6) how to get 1*2*3*4*5*6? I checked the Arithmetic Operators in R,but did not found the operators for this function,anyway can do this except the loop? [[alternative HTML version deleted]] _

[R] some R code of linear mixed model

2008-06-17 Thread Manli Yan
Hello everyone: I have some quesions about the R code for linear mixed model,hope some one can give me some hints,thanks a lot~ Say: we have A B C three factors (i)A is fixed ,B and C are random,and B is nested in C,so the R code for this case would be: case1<-lme(y~A+B+C+..,rando

[R] some r code for linear mixed model

2008-06-16 Thread Manli Yan
Hello everyone: I have some quesions about the R code for linear mixed model,hope some one can give me some hints,thanks a lot~ Say: we have A B C three factors (i)A is fixed ,B and C are random,and B is nested in C,so the R code for this case would be: case1<-lme(y~A+B+C+..,rando

Re: [R] linear model in the repeated data type~

2008-06-04 Thread Manli Yan
ble1, pool=FALSE) > > or > > allFits <- by(table1, table1$id, function(x) lm(y ~ t, data=x)) > > Both ways store the results as a list, so you can access individual results > using list extraction. > > > --Matt > > -Original Message- > From: [EMAIL PR

Re: [R] sorting the data~

2008-06-04 Thread Manli Yan
increasing order but sometime jump through many number like 1 1 5 5,I like them to be 1 1 2 2~ 2008/6/4 Erik Iverson <[EMAIL PROTECTED]>: > Are these the ranks of the data? > > help.search("rank") > > > > Manli Yan wrote: > >>id<-c(1,1,1,1,

[R] sorting the data~

2008-06-04 Thread Manli Yan
id<-c(1,1,1,1,3,3,3,7,7,7,7,11,11,11) how to sort this kind of data to id:(1,1,1,1,2,2,2,3,3,3,3,4,4,4.) thanks~ [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/list

[R] quite complicated case(the repeated data arranage~)

2008-06-04 Thread Manli Yan
Hi everyone: I have been struggling with this repeated data type for whole afternoon,I sent two emails to server for help,many people kindly responded , hereby thank you so much,but since I dont want to write to much in email,so I divide the problem in parts,so far this seem did not work out very

[R] create many variables at one time~

2008-06-04 Thread Manli Yan
I need to create 100 variable ,whose name is id.1,id.2id.100 then I need to let a vector say id<-c(id.1,id.2id.100) any easy way to do this? thanks a lot~ [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

[R] linear model with the repeated data type~

2008-06-04 Thread Manli Yan
here is the data: y<-c(5,2,3,7,9,0,1,4,5) id<-c(1,1,6,6,7,8,15,15,19) t<-c(50,56,50,56,50,50,50,60,50) table1<-data.frame(y,id,t)//longitudinal data the above is only part of data. what I want to do is to use the linear model for each id ,then get the estimate value,like: fit1<-lm(y~t,data=tabl

[R] linear model in the repeated data type~

2008-06-03 Thread Manli Yan
here is the data: y<-c(5,2,3,7,9,0,1,4,5) id<-c(1,1,6,6,7,8,15,15,19) t<-c(50,56,50,56,50,50,50,60,50) table1<-data.frame(y,id,t)//longitudinal data what I want to do is to use the linear model for each id ,then get the estimate value,like: fit1<-lm(y~t,data=table1,subset=(id==1)) but ,you c

[R] how to extract a specific group of data from a table?

2008-06-03 Thread Manli Yan
a table with three varialbe:treatment (low,high),size(large,small),response y I want all response y with treatment=low and size=large, I try to write as : treatment<-c("low","low","high","high") size<-c("small","large","small","large") y<-c(1,2,4,5) table1<-data.frame(treatment,size,y) x=tab

[R] column and row

2008-06-03 Thread Manli Yan
<-fit1$coefficients y.control y.lowy.high (Intercept)19.628713 21.883999 20.023814 log(1 + (age - 45)/10) -7.383725 -6.017342 -5.084431 here is my outcome,I need one vector say b1=first row without the intercept ,like:(19.628713, 21.883999, 20.023814) and