[R] help plsr function

2014-06-23 Thread annie Zhang
Hi All, I want to produce scores from X using $projection. When I predict, I cannot match the predicted scores and scores using x%*%projection. Below is a very simple example, set.seed(seed=1) y - c(1, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0) x - matrix(runif(200),nrow=20) data

Re: [R] get mean from cdf

2011-09-09 Thread annie Zhang
: The diff function would be helpful. ...or not: sum(ppois(0:1000, lambda=2.345, lower=F)) [1] 2.345 (if this was homework: the hard bit is to figure out _why_ this works.) annie Zhang annie.zhang2...@gmail.com wrote: Hi All, How can I get the expected value from a discrete cdf

[R] isotone

2011-09-09 Thread annie Zhang
Hi All, I need some help with the package 'isotone'? I have a big matrix (long) and I want to apply 'lsSolver' possibly with 'activeSet' to each row of the matrix. The plan is to use function 'apply', I tried several ways, but didn't work. Not sure if the FUN is activeSet or lsSolver. If I use

[R] get mean from cdf

2011-09-08 Thread annie Zhang
Hi All, How can I get the expected value from a discrete cdf? Is there any R function that can do this? Thanks, Annie [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help

[R] 2-dim density plot

2011-08-11 Thread annie Zhang
Hi All, I have a 2-dim density defined on 0x1, 0y1, xy. I know the exact formula of the density. How can I visualize it? What plot functions can I use? Thanks, Annie [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

Re: [R] 2-dim density plot

2011-08-11 Thread annie Zhang
Thank you so much, Michael and Duncan. It worked. Annie On Thu, Aug 11, 2011 at 2:23 PM, Duncan Murdoch murdoch.dun...@gmail.comwrote: On 11/08/2011 3:11 PM, annie Zhang wrote: Hi All, I have a 2-dim density defined on 0x1, 0y1, xy. I know the exact formula of the density. How can I

[R] do while loop

2009-12-13 Thread annie Zhang
Hi, All, Is there a 'do while' loop in R for which I can check conditions after? I checked and it seems there is only the 'while' function. Thanks, Annie [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

Re: [R] do while loop

2009-12-13 Thread annie Zhang
Thanks, Uwe. It's very useful. Annie 2009/12/13 Uwe Ligges lig...@statistik.tu-dortmund.de annie Zhang wrote: Hi, All, Is there a 'do while' loop in R for which I can check conditions after? I checked and it seems there is only the 'while' function. Right, but you can use repeat

[R] matched pair proportion test

2009-12-12 Thread annie Zhang
Hi, ALL, Is there any function in R that does the exact test for the matched pair proportions (one sided), which I assume is binomial(b+c, .5). Thanks, Annie [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

Re: [R] matched pair proportion test

2009-12-12 Thread annie Zhang
Yes, thanks. It's exactly what I want. Annie On Sat, Dec 12, 2009 at 12:46 PM, Peter Dalgaard p.dalga...@biostat.ku.dkwrote: annie Zhang wrote: Hi, ALL, Is there any function in R that does the exact test for the matched pair proportions (one sided), which I assume is binomial(b+c, .5

[R] index of min elements in matrix

2009-09-10 Thread annie Zhang
Hi, All, How can I get the indices of the minimum elements in a matrix without using a loop? For example, if the matrix is 4 5 2 2 8 9 5 2 3 Then I want to output (1,3), (2,1), (3,2). Thanks, Annie [[alternative HTML version deleted]] __

Re: [R] index of min elements in matrix

2009-09-10 Thread annie Zhang
Thanks for all your help. Yes, it's very helpful. Annie On Thu, Sep 10, 2009 at 11:42 AM, Marc Schwartz marc_schwa...@me.comwrote: On Sep 10, 2009, at 1:34 PM, annie Zhang wrote: Hi, All, How can I get the indices of the minimum elements in a matrix without using a loop? For example

Re: [R] lrm in Design package--missing value where TRUE/FALSE needed

2009-09-04 Thread annie Zhang
Hi, Frank, I met the same problem. My data does not have NA, when I run fit - lrm(Y_t~.,data=X) The error message is: singular information matrix in lrm.fit (rank= 35 ). Offending variable(s): X35 Error in j:(j + params[i] - 1) : NA/NaN argument How can I avoid this? Thank you, Annie On Fri,

Re: [R] variable selection in logistic

2009-09-03 Thread annie Zhang
Nonclinical Biostatistics -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Frank E Harrell Jr Sent: Wednesday, September 02, 2009 9:07 PM To: annie Zhang Cc: r-help@r-project.org Subject: Re: [R] variable selection in logistic

Re: [R] variable selection in logistic

2009-09-03 Thread annie Zhang
' function in the 'stepPlr' package. Thank you, Annie On Thu, Sep 3, 2009 at 10:11 AM, Frank E Harrell Jr f.harr...@vanderbilt.edu wrote: annie Zhang wrote: Thank you for all your reply. Actually as Bert said, besides predicion, I also need variable selection (I need to know which variables

Re: [R] variable selection in logistic

2009-09-03 Thread annie Zhang
3, 2009, at 1:45 PM, Frank E Harrell Jr wrote: You'll need to do a huge amount of background reading first. These stepwise options do not incorporate penalization. Frank annie Zhang wrote: Hi, Frank, If I want to do prediction as well as to select important predictors, which may

[R] variable selection in logistic

2009-09-02 Thread annie Zhang
Hi, R users, What may be the best function in R to do variable selection in logistic regression? I have the same number of variables as the number of samples, and I want to select the best variablesfor prediction. Is there any function doing forward selection followed by backward elimination in

Re: [R] variable selection in logistic

2009-09-02 Thread annie Zhang
wrote: David Winsemius wrote: On Sep 2, 2009, at 9:36 PM, annie Zhang wrote: Hi, R users, What may be the best function in R to do variable selection in logistic regression? PhD theses, and books by famous statisticians have been pursuing the answer to that question for decades. I

Re: [R] generalized linear models

2009-08-09 Thread annie Zhang
I think I need to restate the problem. If the test data is only a vector, then I am predicting one test sample. But the output from the predict result has the same length as the training set. And there is a warning message about this. Annie On Sat, Aug 8, 2009 at 2:52 PM, annie Zhang

Re: [R] generalized linear models

2009-08-08 Thread annie Zhang
milton.ru...@gmail.com wrote: Hi Annie, create a new data.frame with input variables having all predictors variables on it. after give a look at ?predict best wishes milton On Fri, Aug 7, 2009 at 8:19 PM, annie Zhang annie.zhang2...@gmail.comwrote: Hi, R users, I am trying to use glm

[R] generalized linear models

2009-08-07 Thread annie Zhang
Hi, R users, I am trying to use glm to do logistic regression. I know generally when I have two covariates, say x1 and x2, then I do fit - glm(y~x1+x2,famliy='binomial') But now my covariates form a n*p matrix, say x, so actually each column is a covariate. So I think I should do fit -

[R] penalized logistic regression

2009-08-03 Thread annie Zhang
Hi, R users, Is there any package for penalized logistic regression with more than two response classes? I read the manual for stepPlr, but it seems it's only for binary case. Thank you, Annie [[alternative HTML version deleted]] __