Re: [R] Help in using PCR

From: Jason Lee <huajie.lee_at_gmail.com>
Date: Wed, 02 Jul 2008 00:58:52 +1000

Hi,

Thanks for the reply.

Basically I dont have any label for my data except column 1 which is labeled with Sample1, Sample2...etc...(vertical). My cancerv1 data is data.frame.

So, I used df <- data.frame( x=I(coef(cancerv1(,2:407))), y=cancerv1[,408])before feeding to PCR.

However, I get the below error.

Error in coef(cancerv1(, 2:407)) : could not find function "cancerv1".

I wonder what mistakes did I made in thiscase. My response variable is on column 408 and my predictors are from column 2 to 407.

Please advise. Thanks.

On Tue, Jul 1, 2008 at 6:41 PM, Bjørn-Helge Mevik <b.h.mevik_at_usit.uio.no> wrote:

> Gavin Simpson <gavin.simpson@ucl.ac.uk> writes:
>
> > You can do this another way though, that I feel is more natural. So lets
> > assume that your data frame contains columns that are named, and that
> > one of these is the response variable, the remaining columns are the
> > predictors. Further assume that this response is called 'myresp', then
> > you can proceed by the following:
> >
> > cancerv1.pcr <- pcr(myresp ~ . , ncomp = 6, data = cancerv1,
> > validation = "CV")
>
> This works fine as long as the number of (predictor) variables is not
> too large. With many variables (>> 1000), R will spend a very long time
> dealing with the formula.
>
> --
> Bjørn-Helge Mevik
>
> ______________________________________________
> R-help_at_r-project.org mailing list
>
https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

        [[alternative HTML version deleted]]



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Tue 01 Jul 2008 - 15:02:33 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 01 Jul 2008 - 18:31:42 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive