[R] ungrouped data for multinomial regression

2008-06-28 Thread Rodrigo Briceño
Thanks for helping me out with the thing of quotation marks. I finally
could save time running programs at the university and home.
One additional question for all of you. I'm starting to be familiar
with multinomial regression models. Actually I'm doing some exercise
with the pneumo data that appears in Faraway library. The database has
24 observations and I want to study the probability of getting sick
according with the number of years working at a coal mine.
Here is the issue. For modelling that response what I need to include
in the model is something similar at what is produced by:
xtabs(Freq~year+status). This table provided me the proportions of
people sick according with years worked and severity of the disease.

The question is: do this imply that I need to transform my data
previously to run the regression? how?

Thanks in advance.

__
R-help@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.


[R] use of quotation marks

2008-06-27 Thread Rodrigo Briceño
Dear R Users. I just discovered today a problem in the use of
quotation marks when I'm doing some programs in R. I'm using windows
vista environment.
The programs that I wrote in the University, made in Windows XP
machines run perfectly, but when I run those in my laptop with VISTA,
there are many errors. Those errors are due to the type of quotation
marks.
In the university the quotation marks appear inclined (talking about
position), but in Vista quotation marks are totally vertical. So my
question is how to avoid this issue? Is there an specific font format
that I need to use to avoid those problems???

Thanks in advance for the help.

__
R-help@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.


[R] prediction with ridge regression

2008-05-09 Thread Rodrigo Briceño
I'm running a ridge regression of Y over 8 explanatory variables. The
selection of lambda gave me a value of 1 as the minimum value to be
added for bias. I got the coeficients for this new regression.
The thing is that I have 8 new values for explanatory variables that
are needed in order to predict the response using the ridge regression
already ran. Since I'm not very familiar with the way R functions I
will explain what I did:
1. New values were inserted:
nx=c(64.8,263.7,181.08,178.56,91.44,35.64,40.95,38.79) each
corresponds to a new value for each of the explanatory variables.
Doubt: it is ok on this way or do I need to put like data frame?
x0 = 
data.frame(x1=64.8,x2=263.7,x3=181.08,x4=178.56,x5=91.44,x6=35.64,x7=40.95,x8=38.79)
2. Prediction with the original LM model was done using the command:
predict(spos.mod,x0), where spos.mod is the linear model and x0 is the
new data (data.frame)
3. Not clear how to do the same with ridge, in order to compare the
previous prediction with the one from the new model (spos.ridge)

Any help is really appreciated.

__
R-help@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.


Re: [R] use of sequence on ridge regression

2008-05-07 Thread Rodrigo Briceño
Sorry to bother with this topic, but I'm still not clear about the
meaning of the value set that is used on lambda values. Is there a
correct way of doing that? My doubt is how to choose those 3 values
that appear in the example.
Thanks.

On Wed, May 7, 2008 at 9:29 AM, Prof Brian Ripley <[EMAIL PROTECTED]> wrote:
> On Wed, 7 May 2008, Rodrigo Briceño wrote:
>
>
> > Nice to meet you Brian. The question is about the numbers that appears
> > after lambda (0,0, 0.1, 0.0001). I know that seq is a set of values used
> > for testing which value fits best. But I'm not sure if I need to put
> > whatever I think or what. I tried also with a set of 5 values and I get
> > an error. Is there a maximum allowed?
> >
>
>  So you mean the set of values of lambda?  It is just a set to be use for a
> plot and for searching in the select() methods.
>
>  There is an R function called sequence(), and it is not the same as seq().
>
>
>
>
> >
> > plot(lm.ridge(hipcenter ~ .,seatpos, lambda = seq(0,0.1,0.001)))
> > select(lm.ridge(hipcenter ~ ., seatpos,lambda = seq(0,0.1,0.001)))
> >
> > __
> >
> > Rodrigo Briceño
> > Project Manager
> > Sanigest Internacional
> >
> > +506  22-91-12-00 ext. 113   Oficina Costa Rica
> > +506  22-32-08-30  Fax
> > +506  88-86-11-77  Celular
> > [EMAIL PROTECTED]
> > www.sanigest.com
> >
> > MSN: [EMAIL PROTECTED]
> > SKYPE: rbriceno1087
> >
> > _
> >
> > This communication contains legal information which is privileged and
> > confidential. It is for the exclusive use of the address and
> > distribution, dissemination, copying or use by others is strictly
> > prohibited. If you have received this communication by error, please
> > delete the original message and e-mail us.
> >
> >
> > Esta comunicación contiene información legal privilegiada y confidencial
> > para el uso exclusivo del destinatario. La distribución, diseminación,
> > copia u otro uso por terceras personas es estrictamente prohibida. Si
> > usted ha recibido esta comunicación por error, le rogamos borrar el
> > mensaje original y comunicárnoslo a esta misma dirección.
> >
> >
> >
> > Prof Brian Ripley wrote:
> >  What do you mean by 'the sequence option'?
> >
> >  The authot of lm.ridge
> >
> >  On Wed, 7 May 2008, Rodrigo Briceño wrote:
> >
> >Dear R users. I have a doubt about the use of the
> >sequence option on
> >Ridge regression. I'm trying to understand the
> >use of this option when
> >variables are highly linear correlated. I'm
> >running a model where the
> >variables HtShoes and Ht have high VIF values. My
> >program is written
> >below, but I'm not sure about the correct way of
> >using the sequence
> >option:
> >
> >library (faraway)
> >data (seatpos)
> >attach (seatpos)
> >spos.mod <- lm(hipcenter ~ .,seatpos) summary
> >(spos.mod)
> >library(MASS)
> >lm.ridge(hipcenter ~ .,seatpos)
> >plot(lm.ridge(hipcenter ~ .,seatpos, lambda =
> >seq(0,0.1,0.001)))
> >select(lm.ridge(hipcenter ~ ., seatpos,lambda =
> >seq(0,0.1,0.001)))
> >
> >Any advice will be appreaciated. Rodrigo B.
> >
> >__
> >R-help@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.
> >
> >
> >
> >
> >
>
>
>  --
>  Brian D. Ripley,  [EMAIL PROTECTED]
>  Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
>  University of Oxford, Tel:  +44 1865 272861 (self)
>  1 South Parks Road, +44 1865 272866 (PA)
>  Oxford OX1 3TG, UKFax:  +44 1865 272595

__
R-help@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.


Re: [R] use of sequence on ridge regression

2008-05-07 Thread Rodrigo Briceño
Nice to meet you Brian. The question is about the numbers that appears 
after lambda (0,0, 0.1, 0.0001). I know that seq is a set of values used 
for testing which value fits best. But I'm not sure if I need to put 
whatever I think or what. I tried also with a set of 5 values and I get 
an error. Is there a maximum allowed?

plot(lm.ridge(hipcenter ~ .,seatpos, lambda = seq(0,0.1,0.001)))
select(lm.ridge(hipcenter ~ ., seatpos,lambda = seq(0,0.1,0.001)))

__

*Rodrigo Briceño*
Project Manager
Sanigest Internacional

+506  22-91-12-00 ext. 113  * Oficina* *Costa Rica*
+506  22-32-08-30  *Fax
*+506  88-86-11-77*  Celular**
[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
www.sanigest.com <http://www.sanigest.com/>

MSN: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
SKYPE: rbriceno1087

_

This communication contains legal information which is privileged and 
confidential. It is for the exclusive use of the address and 
distribution, dissemination, copying or use by others is strictly 
prohibited. If you have received this communication by error, please 
delete the original message and e-mail us.


Esta comunicación contiene información legal privilegiada y confidencial 
para el uso exclusivo del destinatario. La distribución, diseminación, 
copia u otro uso por terceras personas es estrictamente prohibida. Si 
usted ha recibido esta comunicación por error, le rogamos borrar el 
mensaje original y comunicárnoslo a esta misma dirección.



Prof Brian Ripley wrote:
> What do you mean by 'the sequence option'?
>
> The authot of lm.ridge
>
> On Wed, 7 May 2008, Rodrigo Briceño wrote:
>
>> Dear R users. I have a doubt about the use of the sequence option on
>> Ridge regression. I'm trying to understand the use of this option when
>> variables are highly linear correlated. I'm running a model where the
>> variables HtShoes and Ht have high VIF values. My program is written
>> below, but I'm not sure about the correct way of using the sequence
>> option:
>>
>> library (faraway)
>> data (seatpos)
>> attach (seatpos)
>> spos.mod <- lm(hipcenter ~ .,seatpos) summary (spos.mod)
>> library(MASS)
>> lm.ridge(hipcenter ~ .,seatpos)
>> plot(lm.ridge(hipcenter ~ .,seatpos, lambda = seq(0,0.1,0.001)))
>> select(lm.ridge(hipcenter ~ ., seatpos,lambda = seq(0,0.1,0.001)))
>>
>> Any advice will be appreaciated. Rodrigo B.
>>
>> __
>> R-help@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@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.


[R] use of sequence on ridge regression

2008-05-07 Thread Rodrigo Briceño
Dear R users. I have a doubt about the use of the sequence option on
Ridge regression. I'm trying to understand the use of this option when
variables are highly linear correlated. I'm running a model where the
variables HtShoes and Ht have high VIF values. My program is written
below, but I'm not sure about the correct way of using the sequence
option:

library (faraway)
data (seatpos)
attach (seatpos)
spos.mod <- lm(hipcenter ~ .,seatpos) summary (spos.mod)
library(MASS)
lm.ridge(hipcenter ~ .,seatpos)
plot(lm.ridge(hipcenter ~ .,seatpos, lambda = seq(0,0.1,0.001)))
select(lm.ridge(hipcenter ~ ., seatpos,lambda = seq(0,0.1,0.001)))

Any advice will be appreaciated. Rodrigo B.

__
R-help@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.


[R] ridge regression

2008-05-06 Thread Rodrigo Briceño
Thanks to all of you that helped me with the issues of bootstrapping
and downloading packages to a local disk.
As an starter I'm in the lower side of the learning curve, but this R
software is awesome. What I like most is this kind of forums when
people share their problems and we can find solutions.
My new inquiry is short: do any of you have some example (besides the
one that appears in help) about a simple ridge regression application
in R? I'm trying to figure out how the program estimates the constant
value that is most appropiate to run regression and how can I see that
value in the plot.
My operative system: windows XP, running R 2.6.2
Thanks to all

__
R-help@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.


[R] ridge regression

2008-05-06 Thread Rodrigo Briceño
Thanks to all of you that helped me with the issues of bootstrapping
and downloading packages to a local disk.
As an starter I'm in the lower side of the learning curve, but this R
software is awesome. What I like most is this kind of forums when
people share their problems and we can find solutions.

My new inquiry is short: do any of you have some example (besides the
one that appears in help) about a simple ridge regression application
in R? I'm trying to figure out how the program estimates the constant
value that is most appropiate to run regression and how can I see that
value in the plot.

My operative system: windows XP, running R 2.6.2

Thanks to all

__
R-help@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.


[R] downloading packages at local disk

2008-05-05 Thread Rodrigo Briceño
Hi again R users. I was reviewing the manual of R about how to install
packages using the GUI and it's corresponding menu packages. My
question is how to download a specific set of packages in order to
install them in a computer that doesn't have internet access. Is there
a web page where I can search those packages? Basically I'm trying to
copy in a flash drive the packages MASS, BOOT and CAR.

Thanks for your help.

Rodrigo Briceño

__
R-help@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.


[R] Fwd: my first post to the list

2008-05-02 Thread Rodrigo Briceño
Hello R-listers! My first post to the list is a very simple one for
those who use the software continuosly. I am trying to understand the
fixed-x resampling and random-x-resampling method proposed by Fox
about Bootstrapping. The doubt that I have is on the side of the model
run in one of the functions expressed for fixed-x resampling. What I
don't understand is: X=model.matrix, and the -1 under mod= rlm. Please
see below:
#fixed x-resampling
fit <- fitted(mod.duncan.hub)
e <- residuals(mod.duncan.hub)
X <- model.matrix(mod.duncan.hub)
boot.huber.fixed <- function(data, indices, maxit=20){
y <- fit + e[indices]
mod <- rlm(y ~ X - 1, maxit=maxit)
coefficients(mod)
}
duncan.fix.boot <- boot(Duncan, boot.huber.fixed, 1999, maxit=100)
duncan.fix.boot

I just need a quick explanation about WHAT the functions mean or do in
this context.
Thanks

__
R-help@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.


[R] my first post to the list

2008-05-02 Thread Rodrigo Briceño
Hello R-listers! My first post to the list is a very simple one for those
who use the software continuosly. I am trying to understand the fixed-x
resampling and random-x-resampling method proposed by Fox about
Bootstrapping. The doubt that I have is on the side of the model run in one
of the functions expressed for fixed-x resampling. What I don't understand
is: X=model.matrix, and the -1 under mod= rlm. Please see below:
#fixed x-resampling
fit <- fitted(mod.duncan.hub)
e <- residuals(mod.duncan.hub)
X <- model.matrix(mod.duncan.hub)
boot.huber.fixed <- function(data, indices, maxit=20){
y <- fit + e[indices]
mod <- rlm(y ~ X - 1, maxit=maxit)
coefficients(mod)
}
duncan.fix.boot <- boot(Duncan, boot.huber.fixed, 1999, maxit=100)
duncan.fix.boot

I just need a quick explanation about WHAT the functions mean or do in this
context.
Thanks

[[alternative HTML version deleted]]

__
R-help@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.