[R] Robust PLS

2007-07-20 Thread Pedro Mardones
Dear all; Does anyone have written or know where to get a function for fitting robust partial least squares in R? Thanks for any ideas PM __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting

[R] PCA + xValidation

2007-06-29 Thread Pedro Mardones
Dear R users; Is there any package or function that I can use to perform LOOCV with prcomp? Basically I want to use that approach to get an idea of the optimal number of PC. Thanks for any idea PM __ R-help@stat.math.ethz.ch mailing list

[R] question about formula for lm

2007-06-14 Thread Pedro Mardones
Dear all; Is there any way to make this to work?: .x-rnorm(50,10,3) .y-.x+rnorm(50,0,1) X-data.frame(.x,.y) colnames(X)-c(Xvar,Yvar) Ytext-Yvar lm(Ytext~Xvar,data=X) # doesn't run lm(Yvar~Xvar,data=X) # does run The main idea is to use Ytext as input in a function, so you just type Yvar and

[R] legend + expression

2007-06-08 Thread Pedro Mardones
Dear all; A simple? question. I'm having a problem with a math expression in the legend of a plot and I haven't found the way to get this to work, so any help will be appreciate. Basically I want to include in the plot is the R-squared and its numerical value, so I tried this: R2c-0.82879 #

[R] how to get column/row info from a dist object?

2007-05-11 Thread Pedro Mardones
Dear R users; Is it possible to get the row and column number of a particular entry in a dist object? Let's say that I want to find the position of the value 1.1837 (the last entry on the dist object below), that is [6,3]. Can I get those values without transforming the object to a matrix?, i.e.

Re: [R] how to get column/row info from a dist object?

2007-05-11 Thread Pedro Mardones
(*, call)= language dist(x = x) So, AFAIK if you want to get references for rows and columns you need to make it an object that indeed has rows and columns, i.e. a matrix. See ?which to obtain the reference you want in a matrix. Regards, Francisco Pedro Mardones wrote: Dear R users

[R] intersect filled.contour and polygon

2007-04-30 Thread Pedro Mardones
Dear R users; Is there any way to intersect a filled contour image and a polygon? My problem is that I want to create a kriging map and the boundaries of my map are given by the coordinates of the polygon. So far I can superompose the polygon in the filled.contour image but I don't know how to

[R] gnls warning message

2007-04-25 Thread Pedro Mardones
Dear R users; I was trying to fit a nonlinear model using gnls (nlme version 3.1-80, R 2.5.0, WinXP) and I got the following error and warning message: Error in gnls(ht ~ a1 * hd * (1 - a2 * exp(-a3 * (dbh/dq2))), data = hdat, : Step halving factor reduced below minimum in NLS step In

[R] kennard-stone selection algorithm

2007-01-21 Thread Pedro Mardones
Dear R users; I've been looking for an R implementation of the cadex and/or duplex algorithm [Kennard-Stone (1969), Snee (1977)] for selecting samples for calibration models with no success so far. Does anyone know if these algorithms have been implemented in R, maybe with different name(s)?

[R] sequential row selection in dataframe

2006-12-25 Thread Pedro Mardones
Dear all; I'm wondering if there is any 'efficient' approach for selecting a sample of 'every nth rows' from a dataframe. For example, let's use the dataframe GAGurine in MASS library: length(GAGurine[,1]) [1] 314 # select an 75% of the dataset, i.e. = 236 rows, every 2 rows starting from row

[R] R2.4 xyplot + panel.number problem

2006-11-28 Thread Pedro Mardones
Hi all; I'm trying to display a 2 panel plot for the Puromycin data from R with 2 different non-linear models fitted to each group. The problem is that as far as I know panel.number doesn't work in the latest version of R. Can anyone give a hint how to solve this? Here is the code that I used

[R] least median squares

2006-10-21 Thread Pedro Mardones
Does anyone can provide a code to implement least median squares regression in R (not using the lqs function or calling C functions)? Reason: teaching/learning purposes Thanks PM __ R-help@stat.math.ethz.ch mailing list