[R] comparing two columns of a dataset on a graph

2008-03-10 Thread orkun
hello

I want to compare the values of two columns of a dataset on a graph. 
Which graphic do you recommend ?

regards


Ahmet Temiz


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

__
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] Problems with installing the rgl package on Linux

2008-03-10 Thread Tim Carnus
HI Paul, 

I had same problem on ubuntu 7.10. Followed advice here
http://help.nceas.ucsb.edu/index.php...ng_R_on_Ubuntu 

and now it works fine. Something about missing headers for X. Alternatively 
something like the libx11-dev package does the trick but may give you a bit 
more than you need. 

Hope this helps.

Tim.

Message: 1
Date: Sat, 8 Mar 2008 11:05:29 +
From: "Paul Smith" <[EMAIL PROTECTED]>
Subject: [R] Problems with installing the rgl package on Linux
To: r-help <[EMAIL PROTECTED]>
Message-ID:
<[EMAIL PROTECTED]>
Content-Type: text/plain; charset=ISO-8859-1

Dear All,

I am trying to install the rgl package on R 2.6.1 running on Fedora 8
(Linux), but I am experiencing the following problems:

-
configure: error: X11 not found but required, configure aborted.
ERROR: configuration failed for package 'rgl'
** Removing '/usr/lib/R/library/rgl'
-

Any ideas?

Thanks in advance,

Paul

__
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] [ca package] access to any x/y in mjca function

2008-03-10 Thread popiel

Hi,

I would like to extract x,y from mjca function in ca package to be able to
draw other graph types.

For example for simple mca function from MASS I can do the following:

-
anydata.mca <- mca(anydata, nf = 2, abbrev = TRUE)

x <- anydata.mca$rs[,1]#that is what I can 'extract'
y <- anydata.mca$rs[,2]

plot(anydata.mca) #standard plot

library(lattice)
xyplot(x~y)  # I can draw this as well apart from plot or export x,y.
--

With ca package and mjca function I have tried so far with every variable
but without succes - anyone can help me? Maybe its simply impossible.

--
anydata.mjca <- mjca(anydata, lambda = "JCA")

#x <- anydata.mjca ??? how to get here...
#y <- anydata.mjca ???

plot(anydata.mjca, mass = TRUE, contrib = "absolute", map = "rowgreen",
arrows = c(FALSE, TRUE))
-

And I want any configuration of x/y from this plot or any other map/plot
type.

Thanks,
P 
-- 
View this message in context: 
http://www.nabble.com/-ca-package--access-to-any-x-y-in-mjca-function-tp15945194p15945194.html
Sent from the R help mailing list archive at Nabble.com.

__
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] Error in extracting monthly observation from a daily time series data

2008-03-10 Thread Megh Dal
Hi all,
   
  Suppose I have following dataset :
   
  library(zoo)
  SD = 1
date1 = seq(as.Date("01/01/90", format = "%m/%d/%y"), as.Date("12/31/08", 
format = "%m/%d/%y"), by = 1)
len1 = length(date1); data1 = zoo(matrix(rnorm(len1, mean=0, sd=SD*0.5), nrow = 
len1),  date1)

  Now I want to extract monthly observation. 
   
  obs = split(as.data.frame(data1), format(index(data1), "%y%m"))

  However surprisingly order of the observation has been changed :
  > head(obs, 1)
$`0001`
 data1
2000-01-01 -0.11638271
2000-01-02 -0.69384682
2000-01-03 -1.20472671
2000-01-04 -0.29262033
2000-01-05 -0.49685794
2000-01-06  0.27514305
2000-01-07 -0.34568013
2000-01-08  0.46075677
2000-01-09 -1.37813508
2000-01-10  0.04960789
2000-01-11  0.42585954
2000-01-12 -0.12685112
2000-01-13  0.24664998
2000-01-14  0.41344957
2000-01-15  0.68487436
2000-01-16 -0.67718350
2000-01-17 -0.39434446
2000-01-18 -0.21775954
2000-01-19  0.10819901
2000-01-20  0.17013283
2000-01-21 -0.49088991
2000-01-22  0.69400376
2000-01-23  0.16209050
2000-01-24  0.03103822
2000-01-25 -0.27605458
2000-01-26  0.01629620
2000-01-27  0.61727694
2000-01-28 -0.55922333
2000-01-29  0.01503502
2000-01-30  0.77450595
2000-01-31  0.11679859

  > tail(obs, 1)
$`9912`
  data1
1999-12-01  0.249002645
1999-12-02 -0.281302740
1999-12-03  0.672597155
1999-12-04  0.486135990
1999-12-05  0.402131711
1999-12-06 -0.754141509
1999-12-07 -0.233711029
1999-12-08 -0.064699202
1999-12-09  0.399164668
1999-12-10 -0.199112521
1999-12-11 -0.422189671
1999-12-12 -0.364795664
1999-12-13  0.175806461
1999-12-14  1.273859234
1999-12-15  0.366671124
1999-12-16 -0.339057003
1999-12-17  0.073700906
1999-12-18  0.009310303
1999-12-19 -0.156223136
1999-12-20  0.177122831
1999-12-21 -0.429045076
1999-12-22  0.207632845
1999-12-23  0.765920096
1999-12-24  0.605439902
1999-12-25 -0.294758511
1999-12-26 -0.481038222
1999-12-27 -0.200035965
1999-12-28 -0.177786043
1999-12-29  0.205357694
1999-12-30 -0.528382812
1999-12-31 -0.398879255

  If you compare this with my actual data then it will be clear :
   
  > head(data1, 5)
  
1990-01-01 -0.59800528
1990-01-02  0.84037877
1990-01-03  0.02663068
1990-01-04 -1.3856
1990-01-05 -0.18783481

  How I can sort 'obs' in proper way? Precisely I want to see 'obs' starts from 
1990 only
   
  Your help will be highly appreciated.

   
-

[[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] extracting p-value from an lrm object

2008-03-10 Thread Shubha Vishwanath Karanth
Hi,

 

How can I extract p-values from an 'lrm' (logistic regression model)
oject?

 

Thank you,

Shubha

 

This e-mail may contain confidential and/or privileged i...{{dropped:13}}

__
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] Bessel functions of complex argument

2008-03-10 Thread Robin Hankin
Hello Baptiste

Bessel functions with complex arguments
are not supported in R.

Neither  matlab nor the  Gnu Scientific Library support them either.

. . . but . . .

the pari/gp system (released on the GPL) does:


? besselj(1+I,3)
%3 = 0.6919067491368555819808728680 + 0.4484268613977010268818252591*I
?


You can access some pari/gp functionality from within R
by using the elliptic package, although unfortunately
its wrapper function, P.pari(),  is not quite flexible enough
to deal with besselj().

I'd be happy to discuss this offline; P.pari() will need only
minor changes to accommodate besselj().



HTH


Robin




On 9 Mar 2008, at 13:44, baptiste Auguié wrote:

> Dear R users,
>
>
> I'm porting a piece of Matlab code to R, but I'm now stuck with the
> following: I need an equivalent of besselJ(x, nu) that can handle a
> complex argument x. I couldn't find any R implementation. I did find
> a possible fortran solution in SLATEC (< http://www.netlib.org/slatec/
>> , CBESJ-C), however I've never tried to use external C or Fortran
> code together with my R code, so I'm not sure where to go for a
> simple solution.
>
> Any advice welcome,
>
> Best regards
>
> baptiste
>
> _
>
> Baptiste Auguié
>
> Physics Department
> University of Exeter
> Stocker Road,
> Exeter, Devon,
> EX4 4QL, UK
>
> Phone: +44 1392 264187
>
> http://newton.ex.ac.uk/research/emag
> http://projects.ex.ac.uk/atto
>
> __
> 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.

--
Robin Hankin
Uncertainty Analyst and Neutral Theorist,
National Oceanography Centre, Southampton
European Way, Southampton SO14 3ZH, UK
  tel  023-8059-7743

__
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] R error: Not able to launch R 2.6.2

2008-03-10 Thread Petr PIKAL
Hi

Sometimes also helps to start R from elsewhere, load a package which was 
used in analysis and open .Rdata file.

[EMAIL PROTECTED] napsal dne 09.03.2008 17:45:06:

> Yes. I found one that says to change the extension to RData. Where is 
the
> folder located? I tried looking at the R folder but couldn't find it.

because it has a dot before Rdata. So the name is .Rdata and as such it is 
prevented by your setting of file explorer to show itself. Set it to 
unhide system files and you shall see it.

Regards
Petr

> 
> On 3/9/08, Charilaos Skiadas <[EMAIL PROTECTED]> wrote:
> >
> > On Mar 9, 2008, at 12:12 PM, Keizer_71 wrote:
> >
> > >
> > > Hi Everyone,
> > >
> > > I am having trouble using R. I am not sure what happen but when i
> > > start R, i
> > > am getting error message
> > >
> > > "Fatal Error: Unable to restore saved data in .RData.
> >
> > Just google for "unable to restore saved data in .RData. ", and you
> > are likely to find many posts discussing this.
> >
> > > -I restarted my pc but still same error
> > > -I reinstall R but still same error
> > > -deleted the R folder and have a fresh re-install but still same
> > > issue.
> > >
> > > I am not sure what else i can do.
> > >
> > > any advice?
> > > --
> > > View this message in context: http://www.nabble.com/R-error%3A-Not-
> > > able-to-launch-R-2.6.2-tp15942837p15942837.html
> > > Sent from the R help mailing list archive at Nabble.com.
> >
> > Haris Skiadas
> > Department of Mathematics and Computer Science
> > Hanover College
> >
> >
> >
> >
> >
> 
> 
> -- 
> Christophe Lo
> (078) 8275 7029
> [EMAIL PROTECTED]
> 
>[[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-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] Odp: comparing two columns of a dataset on a graph

2008-03-10 Thread Petr PIKAL
Hi
[EMAIL PROTECTED] napsal dne 10.03.2008 08:12:28:

> hello
> 
> I want to compare the values of two columns of a dataset on a graph. 
> Which graphic do you recommend ?

It depends on what values you have and what you want to compare.

plot(x,y) 

boxplot(x, y)

There are plenty other options in R.

Regards
Petr

> 
> regards
> 
> 
> Ahmet Temiz
> 
> 
> -- 
> This message has been scanned for viruses and
> dangerous content by MailScanner, and is
> believed to be clean.
> 
> __
> 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-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] Odp: Help with Error!

2008-03-10 Thread Petr PIKAL
Hi

If you bother to look into posting guide it will tell you that providing a 
reproducible example is a good way to obtain relevant answers to your 
question. 

And maybe while constructing reproducible example you will find yourself 
what is wrong, learn some more from it and need not wait for an answer.

Regards

Petr
[EMAIL PROTECTED]

[EMAIL PROTECTED] napsal dne 07.03.2008 17:35:50:

> 
> Hi,
> 
> Can anyone explain the following error??
> 
> Error in FUN(newX[, i], ...) : missing observations in cov/cor
> In addition: Warning message:
> In FUN(newX[, i], ...) : NAs introduced by coercion
> 
> svm_modelSAheart1 <- svm(x_training, y_training) is the command i am
> using.my x/y training are working fine.
> 
> If anyone needs more information just let me know!
> 
> Hope to hear from someone soon.
> 
> Regards. 
> 
> -- 
> View this message in context: http://www.nabble.com/Help-with-Error%21-
> tp15900037p15900037.html
> Sent from the R help mailing list archive at Nabble.com.
> 
> __
> 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-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] hclust graphics - plotting many points

2008-03-10 Thread Karin Lagesen

Hello.

I have a distance matrix with lots of distances that I use hclust to
organise. I then plot the results using the plot method of hclust.

However, the plot itself takes around 20 mins to make due to there
being ~700 things in the matrix that I have distances for. I thus
would like to dump this to some graphics format which will let me
examine this further.

I tried dumping it to postscript:

postscript("myfile.ps", height = 50, pointsize=5)
plot(my_hc_object)
dev.off()

What happens is that since most of the items in the matrix have a
distance of zero to something everything just becomes a black smear on
the bottom where I cannot distinguish anything from anything else. I
thus tried increasing the heigth and/or width and also downscaling the
pointsize. None of these improved anything much. 

So, now I am wondering if any of you have any tips for how I can get
something like I get in the x11() window which I can also store and
potentially show other people.

Thanks!

Karin
-- 
Karin Lagesen, PhD student
[EMAIL PROTECTED]
http://folk.uio.no/karinlag

__
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] plotting hclust dendrograms

2008-03-10 Thread Schulze, Diana

Hallo everybody,

I have a question concerning plotting of hclust dendrograms.

I created several of those dendrograms and like to plot them in different
plots. I'd like to have all plots with the same scaling of the y axis so that
they become comparable by eye. That means they should all start at y=0 and
end up with a certain given value, e.g. y=8. I tried the following:

plot(
hclust_object,
main = "Single Linkage Clustering for Outlier Detection",
sub  = "",
axes = FALSE, # y axis is separately drawn by axis
hang = -1,# all leafs start at y=0
)
lines(x = c(0,0), y = c(0,8), type = "n") # force extension of y axis
axis(
side = 2,
at   = seq(0,8,0.5), # at which values of the plot shall
ticks be drawn?
labels = seq(0,8,0.5),
)

But this does not work: the line drawn is simply cutted at the upper end of
the hclust-plot. So what I'm searching for is, I think, a possibility to add
the hclust dendrogram to an existing plot. So this would allow me to swap the
two command plot and lines, so that the extend of the y axis would be given
by the plotting of lines.

Can anyone help me with this?
Thank you very much in advance!

Diana

__
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] hclust graphics - plotting many points

2008-03-10 Thread michael watson (IAH-C)
I'd recommend outputting either as pdf or as a windows metafile 

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On Behalf Of Karin Lagesen
Sent: 10 March 2008 09:54
To: r-help@r-project.org
Subject: [R] hclust graphics - plotting many points


Hello.

I have a distance matrix with lots of distances that I use hclust to
organise. I then plot the results using the plot method of hclust.

However, the plot itself takes around 20 mins to make due to there
being ~700 things in the matrix that I have distances for. I thus
would like to dump this to some graphics format which will let me
examine this further.

I tried dumping it to postscript:

postscript("myfile.ps", height = 50, pointsize=5)
plot(my_hc_object)
dev.off()

What happens is that since most of the items in the matrix have a
distance of zero to something everything just becomes a black smear on
the bottom where I cannot distinguish anything from anything else. I
thus tried increasing the heigth and/or width and also downscaling the
pointsize. None of these improved anything much. 

So, now I am wondering if any of you have any tips for how I can get
something like I get in the x11() window which I can also store and
potentially show other people.

Thanks!

Karin
-- 
Karin Lagesen, PhD student
[EMAIL PROTECTED]
http://folk.uio.no/karinlag

__
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-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] Problems with installing the rgl package on Linux

2008-03-10 Thread Paul Smith
On Sat, Mar 8, 2008 at 5:33 PM, George N. White III
<[EMAIL PROTECTED]> wrote:
>  > I am trying to install the rgl package on R 2.6.1 running on Fedora 8
>  > (Linux), but I am experiencing the following problems:
>  >
>  > -
>  > configure: error: X11 not found but required, configure aborted.
>  > ERROR: configuration failed for package 'rgl'
>  > ** Removing '/usr/lib/R/library/rgl'
>  > -
>  >
>  > Any ideas?
>
>  It worked for me (R-2.6.2 from the CRAN packages).  Such problems are
>  generally due to missing '-devel' packages. Unfortunately, figuring out
>  which package is missing can be problematic. If you have fast internet and
>  ample disk, look at the "Package Manager" + "Browse" + "Development" for
>  missing entries in "Development Libraries" and "X Software Development".
>  On my system, 32 of 34 packages (all but libcurl and libusb) under
>  "Development Libraries" and 41 of 46 packages under "X .." (all but
>  icon-*, libXp, xorg-X11-server, xorg-X11-xbitmaps) have been installed.
>
>  If you need to be economical about installing additional packages,
>  you will need to extract the sources for rgl, built it manually,
>  figure out what was missing (usually a .h file), figure out which
>  library contains the missing file, install, and repeat.  It would
>  be useful to have a R-devdeps rpm that simply contains a list of
>  dependencies on commonly required -devel packages, but of course there
>  will still be problems with packages that use uncommonly required
>  libs.

Thanks, George and Tim. The following command installed the missing packages:

yum groupinstall "X Software Development"

Afterwards, I could install the rlg package, without further trouble.

Paul

__
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] expression matrix

2008-03-10 Thread Jabez Wilson
>Date: Sat, 8 Mar 2008 04:56:58 -0800 (PST)
>From: Keizer_71 <[EMAIL PROTECTED]>
>Subject: [R]  expression matrix
>To: r-help@r-project.org
>Message-ID: <[EMAIL PROTECTED]>
>Content-Type: text/plain; charset=us-ascii

>Hello,

>I am to run this R script but i keep getting this error.

>> expr<-exprs(golubMerge)
>Warning message:
>The exprSet class is deprecated, use ExpressionSet instead 

>I tried to find information on the website but no luck. (exprSet...etc)

>thank you.

  You must be very unlucky indeed. Top hit for me with "ExpressionSet" in 
google was this:
  An Introduction to Bioconductor’s ExpressionSet Class  File Format: 
PDF/Adobe Acrobat - View as HTML
The data in an ExpressionSet is complicated, consisting of expression data from 
mi- ... The ExpressionSet class coordinates all of this data, so that ...
www.bioconductor.org/packages/2.0/bioc/vignettes/Biobase/inst/doc/ExpressionSetIntroduction.pdf
 - Similar pages

   
-

The World 's Favourite Email.
[[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.


Re: [R] Odp: comparing two columns of a dataset on a graph

2008-03-10 Thread Jim Lemon
Petr PIKAL wrote:
> 
>hello
>
>I want to compare the values of two columns of a dataset on a graph. 
>Which graphic do you recommend ?
> 
Hi Petr,
"barp" will compare the two columns displaying the values as heights of 
bars.

"stackpoly" will display superimposed polygons, the upper edges of which 
represent the data values in each column.

"twoord.plot" will dislay two data vectors as point/line plots even if 
they have different ranges.

All are in the plotrix package.

Jim

__
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] aov within subject and contrasts

2008-03-10 Thread guillaume chaumet
Dear R list,
again a newbie question here, so I wish I do not exasperated reader.
This is example of my data.frame

 subject length consistency context   acc  frt
1 1200high scene_c 0.8181818 396.6642
2 2200high scene_c 1.000 595.7778
3 3200high scene_c 0.9090909 510.7315
4 4200high scene_c 0.900 503.
5 5200high scene_c 0.400 523.
6 6200high scene_c 1.000 811.5556
7 7200high scene_c 1.000 661.6402
8 8200high scene_c 1.000 395.
9 9200high scene_c 1.000 514.0909
10   10200high scene_c 0.900 654.6012
11   11200high scene_c 0.900 400.
12   12200high scene_c 0.889 631.1250
...
491800high scene_c 1.000 376.6667
502800high scene_c 1.000 606.2727
513800high scene_c 0.900 541.7778
524800high scene_c 1.000 483.7273
535800high scene_c 0.556 472.4087
...

My experimental plan contain only "within variables": length (200 or 800 ms)
consistency (high or low) and context(scene_c, scene_f, or scene_n) and so I
used aov(frt~length*consistency*context +
Error(subject/(length*consistency*context))) with one row per observation.
How I could obtain simply contrasts for each variables and for interaction?
Do I need using gmodels library with lme?

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.


Re: [R] Statistical Questions: finding differentially expressed

2008-03-10 Thread Jabez Wilson
>Date: Thu, 6 Mar 2008 06:46:07 -0800 (PST)
>From: Keizer_71 <[EMAIL PROTECTED]>
>Subject: [R] Statistical Questions: finding differentially expressed
 >genes
>To: r-help@r-project.org
>Message-ID: <[EMAIL PROTECTED]>
>Content-Type: text/plain; charset=us-ascii


>Hi Everyone,

>I am trying to find a way to do this in excel to tell me which genes
>are the most differentially expressed. Sorry, i couldn't find excel forum
>section in nabble. However, if it is in R it is fine. This is a microarray 
>data,
>and it has been normalized. According to Dov Stekel in Microarray, i will need
 >to calculate log ratio (control-treatment). Once you have the log ratio,
> calculate using paired t-test. Once you calculate the paired t-test,
> you will find the p-value and the t-test. Is there a way in excel to
 > calculate the confidence level that is significant. For example, it will be 
 > under
>1% for all the genes to be differentially expressed. 

>The book did not explained how log ratio will help me determine the
>significant value. 


>GeneID   treatment control treatment control treatment control 
>Gene12.1   1 2 2.2 1.10.7  2.7 
>Gene21.5   1.4   1.72.2   1.3 1.2 
>Gene3  1.4   1.7   1.82.7   1.6  1.5 
>Gene4   2.2   2.42.12.3 2.1  1.9 
>Gene5   2.6   3.42.11.3   2.6 2.9 


>Objective: find genes who are differentially epxressed.


  I'm not sure what you are asking, but to find whether one of your genes is 
significantly expressed is relatively straightforward in R or excel, and you 
have already outlined the procedure yourself. Have you tried to perform a 
paired t test or log transform in either software yet, and if so, what is the 
stumbling block?
  Read and follow the examples given in Dov Stekel's excellent book. There is 
no better microarray statistics primer IMHO, and reasons for log transforms and 
an example of exactly the analysis you require are clearly explained.
  I 

   
-

[[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.


Re: [R] Problems installing packages using the inbuilt facility: "Error i n gzfile(file, "r") : unable to open connection"

2008-03-10 Thread Kauer, Philipp
Thank you Henrik for your response. 

As I indicated at the end of my e-mail, I only have this problem at work, and 
was not be able to replicate it at home (ie packages load fine there). I 
followed the steps you suggested, but unfortunately no luck (below is the 
output). Essentially, the error messages are the same to the one shown in my 
initial e-mail. 

I noticed that Bob Green posted a very similar request on Friday, when he had 
problems performing 'update packages' on a new install of 2.6.2 on Windows XP, 
and it was suggested that some things in the startup directories were not 
working. After some further investigation, I noticed that various packages that 
I instruct to load in my site Rprofile(I am upgrading from an older version of 
R), were not loading properly either, and after removing them, AND using the 
--internet2 option, the problem disappeared. 

To recap for anyone else who is experiencing a similar problem: Try starting R 
with the option --internet2 (to get rid of any problems with 
-open.connection(con, "r") : unable to resolve 'cran.r-project.org' etc), and 
remove any packages in the site and local Rprofile, which do not load properly 
(that seemed to fix the problems experienced with gzfile).

Regards - Philipp




> url = "http://cran.uk.r-project.org/bin/windows/contrib/2.6/ada_2.0-1.zip";
> download.file(url, basename(url), mode="wb") 
trying URL 'http://cran.uk.r-project.org/bin/windows/contrib/2.6/ada_2.0-1.zip'
Error in download.file(url, basename(url), mode = "wb") : 
  cannot open URL 
'http://cran.uk.r-project.org/bin/windows/contrib/2.6/ada_2.0-1.zip'
In addition: Warning message:
In download.file(url, basename(url), mode = "wb") :
  unable to resolve 'cran.uk.r-project.org'

>  file.info(basename(url))
  size isdir mode   mtime   ctime   
atime exe
ada_2.0-1.zip0 FALSE  666 2008-03-10 08:31:16 2008-03-10 08:20:53 
2008-03-10 08:20:53  no

> install.packages(basename(url), repos=NULL)
Error in gzfile(file, "r") : unable to open connection
In addition: Warning messages:
1: In zip.unpack(pkg, tmpDir) : error 1 in extracting from zip file
2: In gzfile(file, "r") :
  cannot open compressed file 'ada/DESCRIPTION', probable reason 'No such file 
or directory'




-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Henrik Bengtsson
Sent: 07 March 2008 23:47
To: Kauer, Philipp
Cc: [EMAIL PROTECTED]
Subject: Re: [R] Problems installing packages using the inbuilt facility: 
"Error i n gzfile(file, "r") : unable to open connection"

Works fine for me on the same setup.  Try this and compare (especially the size 
of the downloaded file):

> url <- 
> "http://cran.uk.r-project.org/bin/windows/contrib/2.6/ada_2.0-1.zip";;
> download.file(url, basename(url), mode="wb")  # Note "wb"!!!
trying URL 'http://cran.uk.r-project.org/bin/windows/contrib/2.6/ada_2.0-1.zip'
Content type 'application/zip' length 971893 bytes (949 Kb) opened URL 
downloaded 949 Kb
> file.info(basename(url))
size isdir mode   mtime   ctime
ada_2.0-1.zip 971893 FALSE  666 2008-03-07 15:43:52 2008-03-07 15:43:28
atime exe
ada_2.0-1.zip 2008-03-07 15:43:52  no
> install.packages(basename(url), repos=NULL)
package 'ada' successfully unpacked and MD5 sums checked updating HTML package 
descriptions
> library(ada)
Loading required package: rpart
>

/Henrik

On Fri, Mar 7, 2008 at 10:02 AM, Kauer, Philipp <[EMAIL PROTECTED]> wrote:
> Hi
>
>  I have been trawling the web, FAQs, and R manuals for help on the following 
> issue, but have failed and was wondering if anyone has a solution to the 
> following problem:
>
>  After having installed R 2.6.2 for Windows (binary), I tried to install 
> various packages. Every time I try loading a package (any package) via the 
> built-in menu, I run into the following error message.
>
>  > utils:::menuInstallPkgs()
>  trying URL 
> 'http://cran.uk.r-project.org/bin/windows/contrib/2.6/ada_2.0-1.zip 
>  '
>  Content type 'application/zip' length 971893 bytes (949 Kb)  opened 
> URL  downloaded 949 Kb
>
>  Warning in gzfile(file, "r") :
>   cannot open compressed file 'ada/DESCRIPTION', probable reason 'No such 
> file or directory'
>  Error in gzfile(file, "r") : unable to open connection  > traceback()
>  6: gzfile(file, "r")
>  5: read.dcf(file.path(curPkg, "DESCRIPTION"), c("Package", "Version",
>"Type"))
>  4: unpackPkg(foundpkgs[okp, 2], foundpkgs[okp, 1], lib, 
> installWithVers)
>  3: .install.winbinary(pkgs = pkgs, lib = lib, contriburl = contriburl,
>method = method, available = available, destdir = destdir,
>installWithVers = installWithVers, dependencies = dependencies)
>  2: install.packages(NULL, .libPaths()[1], dependencies = NA, type = 
> type)
>  1: utils:::menuInstallPkgs()
>
>  I tried saving the ZIP  of the package to

Re: [R] ltm package question

2008-03-10 Thread Dimitris Rizopoulos
the Pearson chi^2 is not directly computed in 'ltm', and the reason is 
that both the Pearson chi^2 and the likelihood-ratio statistics do not 
follow the claimed chi-squared distribution, especially as the number 
of items increases. If you still need to compute it, then you can use 
the following simple function:

chisq.irt <- function (object) {
if (!class(object) %in% c("ltm", "rasch", "tpm"))
stop("Use only with 'ltm', 'rasch' or 'tpm' objects.\n")
nam.obj <- deparse(substitute(object))
p <- ncol(object$X)
X <- expand.grid(rep(list(c(0, 1)), p))
res <- residuals(object, resp.patterns = data.matrix(X))
Tstat <- sum((res[, "Resid"])^2)
df <- 2^p - attr(logLik(object), "df") - 1
pval <- pchisq(Tstat, df, lower.tail = FALSE)
names(Tstat) <- "X^2"
names(df) <- "df"
rval <- list(statistic = Tstat, parameter = df, p.value = pval,
alternative = "the fitted IRT model is not appropriate for the 
data set",
method = "Pearson X^2 for IRT Models",
data.name = paste("data from model '", nam.obj, "'", sep = 
""))
class(rval) <- "htest"
rval
}

# Some examples
library(ltm)
fitRasch <- rasch(LSAT, constraint = cbind(length(LSAT) + 1, 1))
fit1PL <- rasch(LSAT)
fit2PL <- ltm(LSAT ~ z1)

chisq.irt(fitRasch)
chisq.irt(fit1PL)
chisq.irt(fit2PL)

# check also which perform a Bootstrap approximation
# to the distribution of the statistic uner the null
GoF.rasch(fitRasch)
GoF.rasch(fit1PL)


I hope it helps.

Best,
Dimitris


Dimitris Rizopoulos
Biostatistical Centre
School of Public Health
Catholic University of Leuven

Address: Kapucijnenvoer 35, Leuven, Belgium
Tel: +32/(0)16/336899
Fax: +32/(0)16/337015
Web: http://med.kuleuven.be/biostat/
 http://www.student.kuleuven.be/~m0390867/dimitris.htm


- Original Message - 
From: "Davood Tofighi" <[EMAIL PROTECTED]>
To: 
Sent: Monday, March 10, 2008 4:16 AM
Subject: [R] ltm package question


> Hello All,
>
> I was wondering how I can get the overall Pearson chi^2 test of 
> model fit
> with its df and p value in the LTM package for the 2PL models.
>
> Thanks,
>
> -- 
> Davood Tofighi
> Department of Psychology
> Arizona State University
>
> [[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.
> 


Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm

__
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] (no subject)

2008-03-10 Thread Alfons Sutter
Hi all,

I am trying to read a text file in R! I have a warning message:

In read.table(file = "data1.txt", header = T) : uncompleted last line of 
readTableHeader in 'data1.txt'

Could you please tell me why? and how can I deal with missing value when I read 
this file?

all the best
Alfons


  



[[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] question for aov and kruskal

2008-03-10 Thread eugen pircalabelu
Hi R users!

I have the following problem: how appropriate is my aov model under the 
violation of anova assumptions?

Example:
a<-c(1,1,1,1,1,1,1,1,1,1,2,2,2,3,3,3,3,3,3,3)
b<-c(101,1010,200,300,400, 202, 121, 234, 55,555,66,76,88,34,239, 30, 40, 
50,50,60)
z<-data.frame(a, b)
fligner.test(z$b, factor(z$a))
aov(z$b~factor(z$a))->ll
TukeyHSD(ll)

Now from the aov i found that my  model is unbalanced, and from the flinger 
test  i found out that the assumption of homogeneity  of variances is rejected. 
Could my Tukey comparison be a valid one under these violations? From what i 
read the Tukey test is valid only when the model is balanced and when the 
assumption of homogeneity of variances is not rejected, am i wrong? Can anyone 
tell me what would be the correct test in this case?  

Doing a non-parametric Kruskal - wallis test would give me a different result. 
But what would be the correct multiple comparison test in this case?


Thank you and have a great day ahead!
 



   
-

[[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.


Re: [R] format a number

2008-03-10 Thread Romain Francois
Hello,

 > sub( "^([- ])?0+", "\\1", format(v, digits=2) )
[1] " .44" "-.22"

Cheers,

Romain


Martin Kaffanke wrote:
> Hi there!
>
> I have i.e. v = c(0.43554, -0.22343), and so on.  Now I'd like to make a
> format like
>
> format(v, digits=2)  but without the leading 0, so 0.43554 becomes .44,
> -0.22343 becomes -.22 
>
> How can I do that?
>
> runnable example for copy and paste:
>
> v = c(0.43554, -0.22343)
> format(v, digits=2)
>
> Thanks,
> Martin
-- 

Mango Solutions
data analysis that delivers

Tel:  +44(0) 1249 76 77 00
Fax:  +44(0) 1249 76 77 07
Mob:  +44(0) 7813 52 61 23

__
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] (no subject)

2008-03-10 Thread Alfons Sutter
Thank you! I have the origenal file in MS-Excel, I save the excel file in a txt 
file. In the excel file there are missing value empty places for these missing 
value? Do I need to replace the empty places in a symbol for missing value and 
could you tell me place how can I avoid this warning message?

Thank you in advance!

- Original Message 
From: Duncan Murdoch <[EMAIL PROTECTED]>
To: Alfons Sutter <[EMAIL PROTECTED]>
Cc: [EMAIL PROTECTED]
Sent: Monday, March 10, 2008 12:18:11 PM
Subject: Re: [R] (no subject)

On 10/03/2008 6:50 AM, Alfons Sutter wrote:
> Hi all,
> 
> I am trying to read a text file in R! I have a warning message:
> 
> In read.table(file = "data1.txt", header = T) : uncompleted last line of 
> readTableHeader in 'data1.txt'

R is warning you that the file may be incomplete. In Unix, text files 
are supposed to always end with a newline.  Windows programs often omit 
it on the last line.  So on Unix, R is probably right to warn you, but 
it could well be a false positive if you're on Windows.

> Could you please tell me why? and how can I deal with missing value when I 
> read this file?

How you deal with missing values really depends on what you want to do 
with the data.  There's no general answer.

Duncan Murdoch


  

Looking for last minute shopping deals?  

[[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] format a number

2008-03-10 Thread Martin Kaffanke
Hi there!

I have i.e. v = c(0.43554, -0.22343), and so on.  Now I'd like to make a
format like

format(v, digits=2)  but without the leading 0, so 0.43554 becomes .44,
-0.22343 becomes -.22 

How can I do that?

runnable example for copy and paste:

v = c(0.43554, -0.22343)
format(v, digits=2)

Thanks,
Martin

-- 
Ihr Partner für Webdesign, Webapplikationen und Webspace.
http://www.roomandspace.com/
Martin Kaffanke +43 650 4514224


signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil
__
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] (no subject)

2008-03-10 Thread Duncan Murdoch
On 10/03/2008 6:50 AM, Alfons Sutter wrote:
> Hi all,
> 
> I am trying to read a text file in R! I have a warning message:
> 
> In read.table(file = "data1.txt", header = T) : uncompleted last line of 
> readTableHeader in 'data1.txt'

R is warning you that the file may be incomplete. In Unix, text files 
are supposed to always end with a newline.  Windows programs often omit 
it on the last line.  So on Unix, R is probably right to warn you, but 
it could well be a false positive if you're on Windows.

> Could you please tell me why? and how can I deal with missing value when I 
> read this file?

How you deal with missing values really depends on what you want to do 
with the data.  There's no general answer.

Duncan Murdoch

__
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] Error in extracting monthly observation from a daily time series data

2008-03-10 Thread Gabor Grothendieck
names(obs) shows the result has been sorted so
use %Y instead of %y in the format statement in
the split so that "2000" > "1999"; otherwise,
"99" > "00".

On Mon, Mar 10, 2008 at 4:10 AM, Megh Dal <[EMAIL PROTECTED]> wrote:
> Hi all,
>
>  Suppose I have following dataset :
>
>  library(zoo)
>  SD = 1
> date1 = seq(as.Date("01/01/90", format = "%m/%d/%y"), as.Date("12/31/08", 
> format = "%m/%d/%y"), by = 1)
> len1 = length(date1); data1 = zoo(matrix(rnorm(len1, mean=0, sd=SD*0.5), nrow 
> = len1),  date1)
>
>  Now I want to extract monthly observation.
>
>  obs = split(as.data.frame(data1), format(index(data1), "%y%m"))
>
>  However surprisingly order of the observation has been changed :
>  > head(obs, 1)
> $`0001`
> data1
> 2000-01-01 -0.11638271
> 2000-01-02 -0.69384682
> 2000-01-03 -1.20472671
> 2000-01-04 -0.29262033
> 2000-01-05 -0.49685794
> 2000-01-06  0.27514305
> 2000-01-07 -0.34568013
> 2000-01-08  0.46075677
> 2000-01-09 -1.37813508
> 2000-01-10  0.04960789
> 2000-01-11  0.42585954
> 2000-01-12 -0.12685112
> 2000-01-13  0.24664998
> 2000-01-14  0.41344957
> 2000-01-15  0.68487436
> 2000-01-16 -0.67718350
> 2000-01-17 -0.39434446
> 2000-01-18 -0.21775954
> 2000-01-19  0.10819901
> 2000-01-20  0.17013283
> 2000-01-21 -0.49088991
> 2000-01-22  0.69400376
> 2000-01-23  0.16209050
> 2000-01-24  0.03103822
> 2000-01-25 -0.27605458
> 2000-01-26  0.01629620
> 2000-01-27  0.61727694
> 2000-01-28 -0.55922333
> 2000-01-29  0.01503502
> 2000-01-30  0.77450595
> 2000-01-31  0.11679859
>
>  > tail(obs, 1)
> $`9912`
>  data1
> 1999-12-01  0.249002645
> 1999-12-02 -0.281302740
> 1999-12-03  0.672597155
> 1999-12-04  0.486135990
> 1999-12-05  0.402131711
> 1999-12-06 -0.754141509
> 1999-12-07 -0.233711029
> 1999-12-08 -0.064699202
> 1999-12-09  0.399164668
> 1999-12-10 -0.199112521
> 1999-12-11 -0.422189671
> 1999-12-12 -0.364795664
> 1999-12-13  0.175806461
> 1999-12-14  1.273859234
> 1999-12-15  0.366671124
> 1999-12-16 -0.339057003
> 1999-12-17  0.073700906
> 1999-12-18  0.009310303
> 1999-12-19 -0.156223136
> 1999-12-20  0.177122831
> 1999-12-21 -0.429045076
> 1999-12-22  0.207632845
> 1999-12-23  0.765920096
> 1999-12-24  0.605439902
> 1999-12-25 -0.294758511
> 1999-12-26 -0.481038222
> 1999-12-27 -0.200035965
> 1999-12-28 -0.177786043
> 1999-12-29  0.205357694
> 1999-12-30 -0.528382812
> 1999-12-31 -0.398879255
>
>  If you compare this with my actual data then it will be clear :
>
>  > head(data1, 5)
>
> 1990-01-01 -0.59800528
> 1990-01-02  0.84037877
> 1990-01-03  0.02663068
> 1990-01-04 -1.3856
> 1990-01-05 -0.18783481
>
>  How I can sort 'obs' in proper way? Precisely I want to see 'obs' starts 
> from 1990 only
>
>  Your help will be highly appreciated.
>
>
> -
>
>[[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-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] format a number

2008-03-10 Thread jim holtman
You can also use sprintf:

> v = c(0.43554, -0.22343)

> sprintf("%.2f", v)
[1] "0.44"  "-0.22"
>


On 3/10/08, Martin Kaffanke <[EMAIL PROTECTED]> wrote:
> Hi there!
>
> I have i.e. v = c(0.43554, -0.22343), and so on.  Now I'd like to make a
> format like
>
> format(v, digits=2)  but without the leading 0, so 0.43554 becomes .44,
> -0.22343 becomes -.22
>
> How can I do that?
>
> runnable example for copy and paste:
>
> v = c(0.43554, -0.22343)
> format(v, digits=2)
>
> Thanks,
> Martin
>
> --
> Ihr Partner für Webdesign, Webapplikationen und Webspace.
> http://www.roomandspace.com/
> Martin Kaffanke +43 650 4514224
>
> __
> 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.
>
>
>


-- 
Jim Holtman
Cincinnati, OH
+1 513 646 9390

What is the problem you are trying to solve?

__
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] format a number

2008-03-10 Thread jim holtman
Sorry, I missed the part about not having th leading zero.  It is too
early yet with daylight savings time and no coffee so far.

On 3/10/08, Martin Kaffanke <[EMAIL PROTECTED]> wrote:
> Hi there!
>
> I have i.e. v = c(0.43554, -0.22343), and so on.  Now I'd like to make a
> format like
>
> format(v, digits=2)  but without the leading 0, so 0.43554 becomes .44,
> -0.22343 becomes -.22
>
> How can I do that?
>
> runnable example for copy and paste:
>
> v = c(0.43554, -0.22343)
> format(v, digits=2)
>
> Thanks,
> Martin
>
> --
> Ihr Partner für Webdesign, Webapplikationen und Webspace.
> http://www.roomandspace.com/
> Martin Kaffanke +43 650 4514224
>
> __
> 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.
>
>
>


-- 
Jim Holtman
Cincinnati, OH
+1 513 646 9390

What is the problem you are trying to solve?

__
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] box-constrained

2008-03-10 Thread Paul Smith
On Sun, Mar 9, 2008 at 9:10 PM, Gustave Lefou <[EMAIL PROTECTED]> wrote:
>  I have another question.
>
>  I have seen there is a function called "constrOptim" in R.
>
>  Is it better than "optim", for example to optimize a function f of two
>  parameters belonging to [0,1] and [0,Infinity] ? Do the methods
>  supplied like Nelder-Mead are better than those of optim ?

Could you please give us a concrete example of what you are trying to optimize?

Paul

__
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] internet proxy settings (win)

2008-03-10 Thread Thomas Steiner
I cannot access internet through R.
My IT-guys told me that I should set the proxy and the port and then
everything will be fine. Where can I set them?
I use R 2.6.2 under Windows 2000 and these settings are those of the
Internet Explorer (no password).

I read 
http://cran.at.r-project.org/bin/windows/base/rw-FAQ.html#The-Internet-download-functions-fail_002e
but staring R by
"C:\Program Files\R\R-2.6.2\bin\Rgui.exe" --internet2
a package update still gives me an error:

> update.packages(ask='graphics')
--- Please select a CRAN mirror for use in this session ---
Fehler: Indizierung außerhalb der Grenzen
Zusätzlich: Warning messages:
1: In read.dcf(file = tmpf) : Line starting ' ...' is malformed!
2: In read.dcf(file = tmpf) : Line starting '...' is malformed!
3: In read.dcf(file = tmpf) : Line starting ' ...' is malformed!

Do you know what I could try next?
Thanks
Thomas

__
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] Odp: comparing two columns of a dataset on a graph

2008-03-10 Thread Charilaos Skiadas
On Mar 10, 2008, at 5:15 AM, Petr PIKAL wrote:

> Hi
> [EMAIL PROTECTED] napsal dne 10.03.2008 08:12:28:
>
>> hello
>>
>> I want to compare the values of two columns of a dataset on a graph.
>> Which graphic do you recommend ?
>
> It depends on what values you have and what you want to compare.
>
> plot(x,y)
>
> boxplot(x, y)
>
> There are plenty other options in R.

When it comes to these, I prefer plot(y~x, data=dataset), since it  
picks up the correct graph depending on what types the variables have.

> Regards
> Petr

Haris Skiadas
Department of Mathematics and Computer Science
Hanover College

__
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] question

2008-03-10 Thread Svyatkovskiy Alexey

Hello, 

I have one more question. I looked through MASS.c file but I couldn't find 
lda(...) function here. I expected that 'lda' function is a part of MASS source 
code. Where can I find the source code for 'lda' - function? 

Best wishes,
Alexey.

__
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] Weighting data when running regressions

2008-03-10 Thread Elena Wilson
Dear R-Help, 

 

I'm new to R and struggling with weighting data when I run regression. I've
tried to use search to solve my problem but haven't found anything helpful
so far.

 

I (successfully) import data from SPSS (15) and try to run a linear
regression on a subset of my data file where WEIGHT is the name of my
weighting variable (numeric), e.g.:

 

library(foreign)

data1=read.spss("File.sav", use.value.labels = FALSE, to.data.frame = TRUE)

summary(data1) ' shows me all the variables OK

attach(data1)

linmod=lm(Y~X1+X2+X3+X4W, subset=(X5==1 & X6==7), weights==WEIGHT)

 

and I get the following Error message:

 

Error in weights == WEIGHT : 

  comparison (1) is possible only for atomic and list types

 

It works perfectly if I don't use the ", weights==WEIGHT" bit

 

 

Could you please let me know what I am doing wrong? 

 

Thank you in advance, 

Lena

 

 

 

 


[[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] Changing font size of Rcmdr (Linux)

2008-03-10 Thread Paul Smith
Dear All,

I have Rcmdr installed on a machine running Fedora 8 (Linux). It works
fine, but I find the fonts of the Script window and of Output window
very small. How can one increase the size of the font use on those
windows?

Thanks in advance,

Paul

__
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] Weird feature in rimage

2008-03-10 Thread Alberto Monteiro
I just noticed a weird feature in rimage. It seems that, when
reading an image, the line/colums are transposed.

See this reproducible example. The final image should be black - but (as 
expected) not an absolute black (mean(z) is 0.015, sd(z) is 0.055 but
max(z) is 1).

Alberto Monteiro

# reproducible example
#
# load image of a cat
#
library(rimage)
x <- read.jpeg(system.file("data", "cat.jpg", package="rimage")) 
#
# save the same image of the cat
# weird feature: dimensions are transposed (!)
#
jpeg("newcat.jpg", width=(dim(x)[2]), height=(dim(x)[1])) 
par(mar=rep(0, 4)) 
plot(x) 
dev.off() 
#
# load second image of the cat - should be similar but not equal
# (jpeg is a lossy format)
#
y <- read.jpeg("newcat.jpg")
#
# Construct the differences
#
z.mat <- abs(x - y)
z <- imagematrix(z.mat)
#
# Watch the differences
#
plot(z)
#
# Analyse the differences
#
mean(z)
sd(z)
max(z)

__
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] (no subject)

2008-03-10 Thread Charilaos Skiadas
If you have an original file in excel, the way I get such files is to  
save them as csv (comma-separated), and then to use read.csv. Then  
these empty spots are more easily handled, since they correspond to  
too successive commas.

Haris Skiadas
Department of Mathematics and Computer Science
Hanover College


On Mar 10, 2008, at 7:26 AM, Alfons Sutter wrote:

> Thank you! I have the origenal file in MS-Excel, I save the excel  
> file in a txt file. In the excel file there are missing value empty  
> places for these missing value? Do I need to replace the empty  
> places in a symbol for missing value and could you tell me place  
> how can I avoid this warning message?
>
> Thank you in advance!
>
> - Original Message 
> From: Duncan Murdoch <[EMAIL PROTECTED]>
> To: Alfons Sutter <[EMAIL PROTECTED]>
> Cc: [EMAIL PROTECTED]
> Sent: Monday, March 10, 2008 12:18:11 PM
> Subject: Re: [R] (no subject)
>
> On 10/03/2008 6:50 AM, Alfons Sutter wrote:
>> Hi all,
>>
>> I am trying to read a text file in R! I have a warning message:
>>
>> In read.table(file = "data1.txt", header = T) : uncompleted last  
>> line of readTableHeader in 'data1.txt'
>
> R is warning you that the file may be incomplete. In Unix, text files
> are supposed to always end with a newline.  Windows programs often  
> omit
> it on the last line.  So on Unix, R is probably right to warn you, but
> it could well be a false positive if you're on Windows.
>
>> Could you please tell me why? and how can I deal with missing  
>> value when I read this file?
>
> How you deal with missing values really depends on what you want to do
> with the data.  There's no general answer.
>
> Duncan Murdoch
>

__
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] Tinn-R related problem

2008-03-10 Thread davidseres

Greetings!

I have an issue with an R editor (namely Tinn-R). A few weeks ago all of a
sudden the backspace, enter and direction keys were not working. I updated
Tinn-R to the newest version but still no sollution. After this I tried
reinstalling it (prior to that I removed Tinn-R and deleted all the
"leftovers" manually) and still no change. In every other execution (e.g.
when I save a file) every key works fine.
I've been looking up tons of forums about this issue and have posted
questions but haven't found any reasonable answer. From what I have read in
the other forums I believe this issue is not necessarily R or Tinn-R related
but might be some hidden Windows settings (I'm using XP) but of this I'm not
sure.
Any suggestions?

David
-- 
View this message in context: 
http://www.nabble.com/Tinn-R-related-problem-tp15950714p15950714.html
Sent from the R help mailing list archive at Nabble.com.

__
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] Weighting data when running regressions

2008-03-10 Thread Charilaos Skiadas
On Mar 10, 2008, at 7:49 AM, Elena Wilson wrote:

>
> linmod=lm(Y~X1+X2+X3+X4W, subset=(X5==1 & X6==7), weights==WEIGHT)

That should likely be weights=WEIGHT, with one equal sign.

Haris Skiadas
Department of Mathematics and Computer Science
Hanover College

__
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] Weighting data when running regressions

2008-03-10 Thread Chuck Cleland
On 3/10/2008 7:49 AM, Elena Wilson wrote:
> Dear R-Help,   
> 
> I'm new to R and struggling with weighting data when I run regression. I've
> tried to use search to solve my problem but haven't found anything helpful
> so far.
> 
> I (successfully) import data from SPSS (15) and try to run a linear
> regression on a subset of my data file where WEIGHT is the name of my
> weighting variable (numeric), e.g.:
> 
> library(foreign)
> 
> data1=read.spss("File.sav", use.value.labels = FALSE, to.data.frame = TRUE)
> 
> summary(data1) ' shows me all the variables OK
> 
> attach(data1)
> 
> linmod=lm(Y~X1+X2+X3+X4W, subset=(X5==1 & X6==7), weights==WEIGHT)
> 
> and I get the following Error message:
> 
> Error in weights == WEIGHT : 
> 
>   comparison (1) is possible only for atomic and list types
> 
> It works perfectly if I don't use the ", weights==WEIGHT" bit

   Try it with just one equals sign after weights:

linmod=lm(Y~X1+X2+X3+X4W, subset=(X5==1 & X6==7), weights=WEIGHT)

> Could you please let me know what I am doing wrong? 
> 
> Thank you in advance, 
> 
> Lena
> 
>   [[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. 

-- 
Chuck Cleland, Ph.D.
NDRI, Inc.
71 West 23rd Street, 8th floor
New York, NY 10010
tel: (212) 845-4495 (Tu, Th)
tel: (732) 512-0171 (M, W, F)
fax: (917) 438-0894

__
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] A stats question -- about survival analysis and censoring

2008-03-10 Thread Geoff Russell
Dear UseRs,

Suppose I have data regarding smoking habits of a prospective cohort and wish
to determine the risk ratio of colorectal cancer in the smokers compared to
the non-smokers.  What do I do at the end of the study with people who die
of heart disease? Can I just censor them exactly the same as people who become
uncontactable or who die in a plane crash?  If not, why not?

I'm thinking that heart disease isn't independent of smoking even though
a death from heart disease is probably uninformative about colorectal
cancer risk. Hence
I suspect simply censoring these deaths will introduce a bias, but I don't know
how to correct for it.

Many thanks,

Geoff Russell -- an interested student

__
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] Tinn-R related problem

2008-03-10 Thread Mario Maiworm
david,
all I can tell you that I am using TINN-R 1.19.4.7 on a win xp prof sp2
machine and it runs just fine. I also use AutoHotkey, a hotkey (key
shortcuts) program which overwrites all program-specific keystrokes. could
it be an issue with keystrokes that are assigned elsewhere?? take a look at
your shortcuts_default.txt file...
Mario.

 
__

Mario Maiworm
Biological Psychology and Neuropsychology
University of Hamburg
Von-Melle-Park 11
D-20146 Hamburg

Tel.: +49 40 42838 3515
Fax.: +49 40 42838 6591

http://bpn.uni-hamburg.de/Maiworm_e.html
http://cinacs.org
__


>>> -Ursprüngliche Nachricht-
>>> Von: [EMAIL PROTECTED] 
>>> [mailto:[EMAIL PROTECTED] Im Auftrag von davidseres
>>> Gesendet: Montag, 10. März 2008 13:29
>>> An: r-help@r-project.org
>>> Betreff: [R] Tinn-R related problem
>>> 
>>> 
>>> Greetings!
>>> 
>>> I have an issue with an R editor (namely Tinn-R). A few 
>>> weeks ago all of a sudden the backspace, enter and 
>>> direction keys were not working. I updated Tinn-R to the 
>>> newest version but still no sollution. After this I tried 
>>> reinstalling it (prior to that I removed Tinn-R and deleted 
>>> all the "leftovers" manually) and still no change. In every 
>>> other execution (e.g.
>>> when I save a file) every key works fine.
>>> I've been looking up tons of forums about this issue and 
>>> have posted questions but haven't found any reasonable 
>>> answer. From what I have read in the other forums I believe 
>>> this issue is not necessarily R or Tinn-R related but might 
>>> be some hidden Windows settings (I'm using XP) but of this 
>>> I'm not sure.
>>> Any suggestions?
>>> 
>>> David
>>> --
>>> View this message in context: 
>>> http://www.nabble.com/Tinn-R-related-problem-tp15950714p1595
0714.html
>>> Sent from the R help mailing list archive at Nabble.com.
>>> 
>>> __
>>> 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-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] internet proxy settings (win)

2008-03-10 Thread Uwe Ligges
Which mirror do you use?

Uwe Ligges

Thomas Steiner wrote:
> I cannot access internet through R.
> My IT-guys told me that I should set the proxy and the port and then
> everything will be fine. Where can I set them?
> I use R 2.6.2 under Windows 2000 and these settings are those of the
> Internet Explorer (no password).
> 
> I read 
> http://cran.at.r-project.org/bin/windows/base/rw-FAQ.html#The-Internet-download-functions-fail_002e
> but staring R by
> "C:\Program Files\R\R-2.6.2\bin\Rgui.exe" --internet2
> a package update still gives me an error:
> 
>> update.packages(ask='graphics')
> --- Please select a CRAN mirror for use in this session ---
> Fehler: Indizierung außerhalb der Grenzen
> Zusätzlich: Warning messages:
> 1: In read.dcf(file = tmpf) : Line starting ' ...' is malformed!
> 2: In read.dcf(file = tmpf) : Line starting '...' is malformed!
> 3: In read.dcf(file = tmpf) : Line starting ' ...' is malformed!
> 
> Do you know what I could try next?
> Thanks
> Thomas
> 
> __
> 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-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] internet proxy settings (win)

2008-03-10 Thread Thomas Steiner
> Which mirror do you use?

As I am living in Vienna, I use "Austria". Which should I try?
Thomas

__
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] build.mim() from the minet package

2008-03-10 Thread Bettina Keller
Hi,

I am trying to contstruct a mutual informtation matrix using the 
function build.mim() from the minet package:

 > build.mim(myData, estimator="empirical")

and I have two questions.

1.) The estimator "empirical" computes the entropy of the empirical 
probability distribution. This probably means it is using this 
definition of the entropy: H = sum_x sum_y p(x,y)* log( p(x,y)/ 
(p(x)*p(x)) ). Is this correct?
2.) Which is basis is used for the log?


Thanks a lot for your in advance.

Bettina Keller

__
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] question for aov and kruskal

2008-03-10 Thread David Winsemius
Subject: Re: question for aov and kruskal
Newsgroups: R-help:gmane.comp.lang.r.general
To: eugen pircalabelu <[EMAIL PROTECTED]>

On 10 Mar 2008, you wrote in gmane.comp.lang.r.general:

> Hi R users!
> 
> I have the following problem: how appropriate is my aov model under
> the violation of anova assumptions? 
> 
> Example:
> a<-c(1,1,1,1,1,1,1,1,1,1,2,2,2,3,3,3,3,3,3,3)
> b<-c(101,1010,200,300,400, 202, 121, 234, 55,555,66,76,88,34,239,
> 30, 40, 50,50,60) z<-data.frame(a, b)
> fligner.test(z$b, factor(z$a))
> aov(z$b~factor(z$a))->ll
> TukeyHSD(ll)
> 
> Now from the aov i found that my  model is unbalanced, and from the
> flinger test  i found out that the assumption of homogeneity  of
> variances is rejected. Could my Tukey comparison be a valid one
> under these violations? From what i read the Tukey test is valid
> only when the model is balanced and when the assumption of
> homogeneity of variances is not rejected, am i wrong? Can anyone
> tell me what would be the correct test in this case?  
> 
> Doing a non-parametric Kruskal - wallis test would give me a
> different result. But what would be the correct multiple comparison
> test in this case? 
> 

If you install the coin package and look at ?oneway_test help panel, 
you 
will see an implementation of what the authors (citing Hollander and 
Wolfe) are calling the Nemenyi-Damico-Wolfe-Dunn test. From the example 
it appears that you also need the multcomp package to run the test.

-- 
David Winsemius

__
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] Changing font size of Rcmdr (Linux)

2008-03-10 Thread John Fox
Dear Paul,

You can change fonts and font sizes via Rcmdr options, as explained in
?Commander (also accessible via the R Commander "Help -> Commander help"
menu). For example, 

options(Rcmdr=list(default.font="*helvetica-medium-r-normal-*-20*",
log.font.size=20))

would change both the GUI elements and text input and output to 20-point
(from the default 12).

I hope this helps,
 John


John Fox, Professor
Department of Sociology
McMaster University
Hamilton, Ontario, Canada L8S 4M4
905-525-9140x23604
http://socserv.mcmaster.ca/jfox


> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> project.org] On Behalf Of Paul Smith
> Sent: March-10-08 8:20 AM
> To: r-help
> Subject: [R] Changing font size of Rcmdr (Linux)
> 
> Dear All,
> 
> I have Rcmdr installed on a machine running Fedora 8 (Linux). It works
> fine, but I find the fonts of the Script window and of Output window
> very small. How can one increase the size of the font use on those
> windows?
> 
> Thanks in advance,
> 
> Paul
> 
> __
> 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-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] relationship between t-test CI and SEM?

2008-03-10 Thread Rob Campbell

Thanks for the replies and apologies for not including code. Bad of me.

 >Chuck Cleland wrote:
 >I get the same confidence intervals with t.test(), lm(), and by hand. 
  >We need to see how you calculated the SEM and constructed the 
interval.  >Perhaps you constructed the interval using the normal 
distribution >rather than the t distribution?

Yes, I was doing this and this was causing a confusion.

I think it's clear now!


Rob

__
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] internet proxy settings (win)

2008-03-10 Thread Uwe Ligges


Thomas Steiner wrote:
>> Which mirror do you use?
> 
> As I am living in Vienna, I use "Austria". Which should I try?
> Thomas

OK, that's perfect. Then the proxy configuration is still wrong. MAybe 
you want to try the other way given in the R for Windows FAQs and 
re-check your proxy settings.

Uwe Ligges

__
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] (no subject)

2008-03-10 Thread Petr PIKAL
Hi

[EMAIL PROTECTED] napsal dne 10.03.2008 13:00:39:

> If you have an original file in excel, the way I get such files is to 
> save them as csv (comma-separated), and then to use read.csv. Then 

Or if you do not have need to save the file just in Excel select data you 
want to transfer to R
press Ctrl - C

In R write
test <- read.delim("clipboard")

and you shall get test data frame. See ?read.delim

Regards
Petr

> these empty spots are more easily handled, since they correspond to 
> too successive commas.
> 
> Haris Skiadas
> Department of Mathematics and Computer Science
> Hanover College
> 
> 
> On Mar 10, 2008, at 7:26 AM, Alfons Sutter wrote:
> 
> > Thank you! I have the origenal file in MS-Excel, I save the excel 
> > file in a txt file. In the excel file there are missing value empty 
> > places for these missing value? Do I need to replace the empty 
> > places in a symbol for missing value and could you tell me place 
> > how can I avoid this warning message?
> >
> > Thank you in advance!
> >
> > - Original Message 
> > From: Duncan Murdoch <[EMAIL PROTECTED]>
> > To: Alfons Sutter <[EMAIL PROTECTED]>
> > Cc: [EMAIL PROTECTED]
> > Sent: Monday, March 10, 2008 12:18:11 PM
> > Subject: Re: [R] (no subject)
> >
> > On 10/03/2008 6:50 AM, Alfons Sutter wrote:
> >> Hi all,
> >>
> >> I am trying to read a text file in R! I have a warning message:
> >>
> >> In read.table(file = "data1.txt", header = T) : uncompleted last 
> >> line of readTableHeader in 'data1.txt'
> >
> > R is warning you that the file may be incomplete. In Unix, text files
> > are supposed to always end with a newline.  Windows programs often 
> > omit
> > it on the last line.  So on Unix, R is probably right to warn you, but
> > it could well be a false positive if you're on Windows.
> >
> >> Could you please tell me why? and how can I deal with missing 
> >> value when I read this file?
> >
> > How you deal with missing values really depends on what you want to do
> > with the data.  There's no general answer.
> >
> > Duncan Murdoch
> >
> 
> __
> 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-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] accessing sourcse code; was: question

2008-03-10 Thread Uwe Ligges


Svyatkovskiy Alexey wrote:
> Hello, 
> 
> I have one more question. I looked through MASS.c file but I couldn't find 
> lda(...) function here. I expected that 'lda' function is a part of MASS 
> source code. Where can I find the source code for 'lda' - function? 

Not everything has its own C code, lda is an R function and the sources 
are in
In MASS/R/lda.R

Please read the posting guide and use sensible subject lines.

Best,
Uwe Ligges



> 
> Best wishes,
> Alexey.
> 
> __
> 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-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] extracting p-value from an lrm object

2008-03-10 Thread David Winsemius
"Shubha Vishwanath Karanth" <[EMAIL PROTECTED]> wrote in
news:[EMAIL PROTECTED]: 

> 
> How can I extract p-values from an 'lrm' (logistic regression model)
> oject?
>
 
a) In writing to the list you should tell people where you got the 
function (presumably Design).

b) Looks to me in running lrm with the first example from the help text 
that the model object is not examined with summary() but rather with 
anova(). If you just need to see p-values for a particular coefficient, 
then run anova(model). If you need to extract the values and your 
variable of interest is age then using the example in lrm help:

anova(f)["age",]  # will give you all the statistics and ...

anova(f)["age","P"] # will give you just the p-value

-- 
David Winsemius

__
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] y label perpendicular to the y axis

2008-03-10 Thread JuanCarlos CorreaMorales
Hi R-users:
   
  We need to place the y label horizontally on a plot. 
   
  Instead of 
 |
  l  |
  a |
  b |
  e |
  l  |
|__
   
  we want
   |
   |
   label |
   |
   |
   |__
   
  We thank you any advice.
   
  Yours,  


Juan Carlos Correa, Ph.D.
Profesor Asociado
Escuela de Estadística
Universidad Nacional-Sede Medellín
A.A. 3840
Medellín COLOMBIA
   
-

[[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.


Re: [R] y label perpendicular to the y axis

2008-03-10 Thread Henrique Dallazuanna
Try:

par(mar=c(4,6,4,4))
plot(rnorm(100), ylab="")
mtext(side=2, text="Label", las=1, line=2)


On 10/03/2008, JuanCarlos CorreaMorales <[EMAIL PROTECTED]> wrote:
> Hi R-users:
>
>   We need to place the y label horizontally on a plot.
>
>   Instead of
>  |
>   l  |
>   a |
>   b |
>   e |
>   l  |
> |__
>
>   we want
>|
>|
>label |
>|
>|
>|__
>
>   We thank you any advice.
>
>   Yours,
>
>
>  Juan Carlos Correa, Ph.D.
>  Profesor Asociado
>  Escuela de Estadística
>  Universidad Nacional-Sede Medellín
>  A.A. 3840
>  Medellín COLOMBIA
>
>  -
>
> [[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.
>
>


-- 
Henrique Dallazuanna
Curitiba-Paraná-Brasil
25° 25' 40" S 49° 16' 22" 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.


Re: [R] internet proxy settings (win)

2008-03-10 Thread Thomas Steiner
> OK, that's perfect. Then the proxy configuration is still wrong. MAybe
> you want to try the other way given in the R for Windows FAQs and
> re-check your proxy settings.

I did try the other ways and the above trial shows some progress:
> utils:::menuInstallPkgs()
--- Please select a CRAN mirror for use in this session ---
Warnung: unable to access index for repository
http://cran.at.r-project.org/bin/windows/contrib/2.6
Warnung: unable to access index for repository
http://www.stats.ox.ac.uk/pub/RWin/bin/windows/contrib/2.6
Fehler in install.packages(NULL, .libPaths()[1], dependencies = NA,
type = type) :
  no packages were specified
Zusätzlich: Warning message:
In open.connection(con, "r") : kann 'cran.r-project.org' nicht auflösen


starting with --internet2:
> utils:::menuInstallPkgs()
--- Please select a CRAN mirror for use in this session ---
Fehler: Indizierung außerhalb der Grenzen
Zusätzlich: Warning messages:
1: In read.dcf(file = tmpf) : Line starting ' ...' is malformed!
2: In read.dcf(file = tmpf) : Line starting '...' is malformed!
3: In read.dcf(file = tmpf) : Line starting ' ...' is malformed!


I also tried
"C:\Program Files\R\R-2.6.2\bin\Rgui.exe"
http_proxy=myproxy.mycompany.com http_port=8080

but it gives the same resuat as the very frist solution ("malformed").

What about the firewall settings mentoined in the FAQ?

Thomas

__
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] re moving parentheses/square brackets from data frame numbers

2008-03-10 Thread Thomsen

Dear list,

I am importing data consisting of numbers into dataframes. Some of the
numbers are flanked by parentheses or square brackets. Thus, they are not
recognized as numeric and the corresponding column is of class "factor"
which makes it hard/impossible use in plotting functions.

Is there a way to remove brackets from numbers in a column/row/dataframe?

Kind regards,

Stefan
-- 
View this message in context: 
http://www.nabble.com/removing-parentheses-square-brackets-from-data-frame-numbers-tp15950774p15950774.html
Sent from the R help mailing list archive at Nabble.com.

__
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] How can I sample from a two-dimensional grid of points

2008-03-10 Thread Gregory Gentlemen
Hi everyone,
   
  My goal is to sample from a two-dimensional grid. Consider the following 
example of code:
   
  n.grid <- 500
muA.grid <- seq(-4,4, length=n.grid)
muB.grid <- seq(-4,4, length=n.grid)
mu.p <- matrix(NA, nrow=n.grid, ncol=n.grid)
for(i in 1:n.grid){
  for(j in 1:n.grid){
mu.p[i,j] <- dnorm(muA.grid[i], 0, 1)*dnorm(muB.grid[j], 0, 0.5)
}
}
   
  mu.p <- mu.p/sum(mu.p)
   
  I would now like to sample the grid of points from the probabilities in mu.p. 
Im using the multivariate normal here for illustration as my real problem is a 
more complicated probability density. If this problem were only 
one-dimensional, this is easy:
   
  n.samples <- 1000 
  # assuming mu.p and muA.grid are now the appropriate vectors
  mu <- sample(muA.grid, n.samples, replace=T, prob=mu.p)
   
  However, im not sure how to do this in two-dimensions in R.
   
  Thanks in advance for any help.
   
  All the best,
  Gregory Gentlemen

   
-

[[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.


Re: [R] A stats question -- about survival analysis and censoring

2008-03-10 Thread Max
Geoff,

This is a tricky question. Have you done a literature search?

-Max

Geoff Russell formulated the question :
> Dear UseRs,
>
> Suppose I have data regarding smoking habits of a prospective cohort and wish
> to determine the risk ratio of colorectal cancer in the smokers compared to
> the non-smokers.  What do I do at the end of the study with people who die
> of heart disease? Can I just censor them exactly the same as people who 
> become uncontactable or who die in a plane crash?  If not, why not?
>
> I'm thinking that heart disease isn't independent of smoking even though
> a death from heart disease is probably uninformative about colorectal
> cancer risk. Hence
> I suspect simply censoring these deaths will introduce a bias, but I don't 
> know how to correct for it.
>
> Many thanks,
>
> Geoff Russell -- an interested student
>
> __
> 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-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] A stats question -- about survival analysis and censoring

2008-03-10 Thread Matthias Gondan
Hi Geoff,

I think the answer to such a problem (overall survival vs. disease free 
survival) depends on the regulatory
environment, for example, in a phase III clinical trial, OS would be 
used, whereas in an equivalence study,
DFS would be used.

Best,

Matthias


Geoff Russell schrieb:
> Dear UseRs,
>
> Suppose I have data regarding smoking habits of a prospective cohort and wish
> to determine the risk ratio of colorectal cancer in the smokers compared to
> the non-smokers.  What do I do at the end of the study with people who die
> of heart disease? Can I just censor them exactly the same as people who become
> uncontactable or who die in a plane crash?  If not, why not?
>
> I'm thinking that heart disease isn't independent of smoking even though
> a death from heart disease is probably uninformative about colorectal
> cancer risk. Hence
> I suspect simply censoring these deaths will introduce a bias, but I don't 
> know
> how to correct for it.
>
> Many thanks,
>
> Geoff Russell -- an interested student
>
> __
> 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-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] How can I sample from a two-dimensional grid of points

2008-03-10 Thread Dimitris Rizopoulos
you can still use sample(), e.g.,

n.grid <- 500
muA.grid <- seq(-4, 4, length = n.grid)
muB.grid <- seq(-4, 4, length = n.grid)

vals <- data.matrix(expand.grid(muA.grid, muB.grid))
mu.p <- dnorm(vals[, 1]) * dnorm(vals[, 2], sd = 0.5)
mu.p <- mu.p / sum(mu.p)

ind <- 1:nrow(vals)
samp.ind <- sample(ind, 1000, TRUE, mu.p)
mu <- vals[samp.ind, ]
head(mu, 10)


I hope it helps.

Best,
Dimitris


Dimitris Rizopoulos
Biostatistical Centre
School of Public Health
Catholic University of Leuven

Address: Kapucijnenvoer 35, Leuven, Belgium
Tel: +32/(0)16/336899
Fax: +32/(0)16/337015
Web: http://med.kuleuven.be/biostat/
 http://www.student.kuleuven.be/~m0390867/dimitris.htm

- Original Message - 
From: "Gregory Gentlemen" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, March 10, 2008 3:32 PM
Subject: [R] How can I sample from a two-dimensional grid of points


> Hi everyone,
>
>  My goal is to sample from a two-dimensional grid. Consider the 
> following example of code:
>
>  n.grid <- 500
> muA.grid <- seq(-4,4, length=n.grid)
> muB.grid <- seq(-4,4, length=n.grid)
> mu.p <- matrix(NA, nrow=n.grid, ncol=n.grid)
> for(i in 1:n.grid){
>  for(j in 1:n.grid){
>mu.p[i,j] <- dnorm(muA.grid[i], 0, 1)*dnorm(muB.grid[j], 0, 0.5)
>}
> }
>
>  mu.p <- mu.p/sum(mu.p)
>
>  I would now like to sample the grid of points from the 
> probabilities in mu.p. Im using the multivariate normal here for 
> illustration as my real problem is a more complicated probability 
> density. If this problem were only one-dimensional, this is easy:
>
>  n.samples <- 1000
>  # assuming mu.p and muA.grid are now the appropriate vectors
>  mu <- sample(muA.grid, n.samples, replace=T, prob=mu.p)
>
>  However, im not sure how to do this in two-dimensions in R.
>
>  Thanks in advance for any help.
>
>  All the best,
>  Gregory Gentlemen
>
>
> -
>
> [[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.
> 


Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm

__
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] Changing font size of Rcmdr (Linux)

2008-03-10 Thread Paul Smith
On Mon, Mar 10, 2008 at 1:36 PM, John Fox <[EMAIL PROTECTED]> wrote:
>  You can change fonts and font sizes via Rcmdr options, as explained in
>  ?Commander (also accessible via the R Commander "Help -> Commander help"
>  menu). For example,
>
>  options(Rcmdr=list(default.font="*helvetica-medium-r-normal-*-20*",
>  log.font.size=20))
>
>  would change both the GUI elements and text input and output to 20-point
>  (from the default 12).

Thanks, John. Done so and now having the font size changed.

Paul




>  > -Original Message-
>  > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
>  > project.org] On Behalf Of Paul Smith
>  > Sent: March-10-08 8:20 AM
>  > To: r-help
>  > Subject: [R] Changing font size of Rcmdr (Linux)
>  >
>  > Dear All,
>  >
>  > I have Rcmdr installed on a machine running Fedora 8 (Linux). It works
>  > fine, but I find the fonts of the Script window and of Output window
>  > very small. How can one increase the size of the font use on those
>  > windows?
>  >
>  > Thanks in advance,
>  >
>  > Paul
>  >
>  > __
>  > 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-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] sampsize in Random Forests

2008-03-10 Thread Liaw, Andy
Are you sure there are 100 sites in your data?  Here's an example:

R> library(randomForest)
randomForest 4.5-23
Type rfNews() to see new features/changes/bug fixes.
R> f <- factor(sample(1:4, nrow(iris), replace=TRUE))
R> rf1 <- randomForest(iris[1:4], iris[[5]], strata=f, sampsize=rep(5,
nlevels(f)))
R> rf1

Call:
 randomForest(x = iris[1:4], y = iris[[5]], strata = f, sampsize =
rep(5,  nlevels(f))) 
   Type of random forest: classification
 Number of trees: 500
No. of variables tried at each split: 2

OOB estimate of  error rate: 4.67%
Confusion matrix:
   setosa versicolor virginica class.error
setosa 50  0 00.00
versicolor  0 47 30.06
virginica   0  4460.08
 

> -Original Message-
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of Naiara Pinto
> Sent: Sunday, March 09, 2008 5:19 PM
> To: r-help@r-project.org
> Subject: [R] sampsize in Random Forests
> 
> Hi all,
> 
> I have a dataset where each point is assigned to a class A, B, C, or
> D. Each point is also assigned to a study site. Each study site is
> coded with a number ranging between 1-100. This information is stored
> in the vector studySites.
> 
> I want to run randomForests using stratified sampling, so I 
> chose the option
> strata = factor(studySites)
> 
> But I am not sure how to control the number of samples taken from each
> study site. I tried to use 10 points from each study site:
> mySampSize = rep(10, 100)
> 
> So my function call looks like:
> RF = randomForest(myClass~., data=myData, mtry=5, importance=TRUE,
> strata = factor(studySites), sampsize=mySampSize)
> 
> But randomForest gives me the following error:
> Error in randomForest.default(m, y, ...) :
> sampsize can not be larger than class frequency
> 
> Does anybody have any idea why this happens?
> 
> Thank you very much,
> 
> Naiara.
> 
> __
> 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.
> 
> 
> 


--
Notice:  This e-mail message, together with any attachme...{{dropped:15}}

__
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] Mimicking SPSS weighted least squares

2008-03-10 Thread Ben Domingue
Howdy,
In SPSS, there are 2 ways to weight a least squares regression:
1. You can do it from the regression menu.
2. You can set a global weight switch from the data menu.
These two options have no, in my experience, been equivalent.
Now, when I run lm in R with the weights= switch set accordingly, I
get the same set of results you would see with option #1 in SPSS.
Does anybody know how to duplicate option #2 from SPSS in R?

Ben

__
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] Rpart and bagging - how is it done?

2008-03-10 Thread Liaw, Andy
I suppose better late than never:  It's possible to get bagging in
randomForest by simply setting mtry equal to the number of  predictor
variables.  Note that this is one thing that I changed from Breiman &
Cutler's Fortran code:  They were sampling variables with replacement,
so if you use that code and set mtry to the number of predictor
variables, you're still not bagging.

One of my colleagues, Ting Wang, had provided a Matlab interface to
Breiman & Cutler's Fortran code (V3.1 I believe) that he made available
on StatLib.  It would be a fairly simple change to the underlying
Fortran code to get it to do bagging.

Andy

From: [EMAIL PROTECTED]
 
> I would like to thank Brian Ripley and Torsten Hothorn for 
> their quick and
> thoughtful responses.
> 
> I rerun the example given by Professor Ripley by just starting R and
> sourcing the code below and I got slightly different results. 
>  Then I ran
> it again setting the random seed before the sample command and I got
> identical results a few times.  However, I found the example 
> below that
> seems to be a reproducible on my system (Win200 Pro, CoreDuo 
> Xeon about a
> year old).   I get the same results in 2.6.2 (patched March 
> 4) and 2.7.0
> (version of February 28).  Both were compiled from the 
> tarballs in Cygwin
> and up-to-date Rtools with no errors.  I just ran "make 
> fullcheck" on 2.6.2
> and it passes with no problems (just usual stuff - network conectivity
> fails due to our firewall and slight numercial differences in 
> a few cases.
> The results from the rpart test are attached included at the 
> bottom of this
> post.
> 
> set.seed(123)
> library(rpart)
> ind <- sample(1:81, replace=TRUE)
> rpart(Kyphosis ~ Age + Number + Start, data=kyphosis[ind,], xval=0)
> rpart(Kyphosis ~ Age + Number + Start, data=kyphosis,
>weights=tabulate(ind, nbins=81), xval=0)
> 
> Here is what I get:
> 
> > rpart(Kyphosis ~ Age + Number + Start, data=kyphosis[ind,], xval=0)
> n= 81
> 
> node), split, n, loss, yval, (yprob)
>   * denotes terminal node
> 
> 1) root 81 14 absent (0.8271605 0.1728395) *
> > rpart(Kyphosis ~ Age + Number + Start, data=kyphosis,
> +weights=tabulate(ind, nbins=81), xval=0)
> n= 81
> 
> node), split, n, loss, yval, (yprob)
>   * denotes terminal node
> 
>  1) root 81 14 absent (0.8271605 0.1728395)
>2) Start>=8.5 62  6 absent (0.9062500 0.0937500)
>  4) Start>=14.5 29  0 absent (1.000 0.000) *
>  5) Start< 14.5 33  6 absent (0.800 0.200)
>   10) Age< 55 12  0 absent (1.000 0.000) *
>   11) Age>=55 21  6 absent (0.600 0.400)
> 22) Age>=111 14  2 absent (0.800 0.200) *
> 23) Age< 111 7  1 present (0.200 0.800) *
>3) Start< 8.5 19  8 absent (0.5294118 0.4705882) *
> 
> The trees are dramatically different (the first one is just a 
> root).  The
> predictions are of course different (the first model predicts 
> all cases as
> absent) but the total number of misclassified observations 
> differs by only
> 1 (17 vs. 16).
> 
> Can anyone reproduce this, or is something wrong with my system?
> 
> Thanks again,
> 
> Andy
> 
> PS.  rpart version is 3.1-39
> 
> rpart results from "make fullcheck"
> 
>  Testing package rpart 
> Massaging examples into 'rpart-Ex.R' ...
> Running examples in 'rpart-Ex.R' ...
> Running specific tests
>   Running `surv_test.R'
>   Running `testall.R'
>   Comparing `testall.Rout' to `testall.Rout.save' ...127c127
> <   g2  < 22.77 to the right, improve=6.8130, (6 missing)
> ---
> >   g2  < 22.76 to the right, improve=6.8130, (6 missing)
> 159c159
> <   g2  < 22.77 to the right, improve=4.8340, (6 missing)
> ---
> >   g2  < 22.76 to the right, improve=4.8340, (6 missing)
> 193c193
> <   grade < 3.5   to the left,  agree=0.772, adj=0.188, (0 split)
> ---
> >   grade < 3.5   to the left,  agree=0.772, adj=0.187, (0 split)
> 199c199
> <   g2  < 13.47 to the left,  improve=3.55300, (0 missing)
> ---
> >   g2  < 13.48 to the left,  improve=3.55300, (0 missing)
> 241c241
> <  1) root 146 53.420  5.893e-18
> ---
> >  1) root 146 53.420 -4.563e-17
> 275c275
> <   mean=5.893e-18, MSE=0.3659
> ---
> >   mean=-4.563e-17, MSE=0.3659
> 346c346
> <   g2  < 13.47 to the left,  improve=4.238e-02, (3 missing)
> ---
> >   g2  < 13.48 to the left,  improve=4.238e-02, (3 missing)
> 375c375
> <   g2  < 17.91 to the right, improve=0.1271000, (1 missing)
> ---
> >   g2  < 17.92 to the right, improve=0.1271000, (1 missing)
> 515c515
> <   g2  < 13.47 to the left,  improve=1.94600, (3 missing)
> ---
> >   g2  < 13.48 to the left,  improve=1.94600, (3 missing)
> 555c555
> <   g2  < 17.91 to the right, improve=3.122000, (1 missing)
> ---
> >   g2  < 17.92 to the right, improve=3.122000, (1 missing)
> 647c647
> <   life   < 70.25 to the right, improve=0.25230, (0 missing)
> ---
> >   

Re: [R] Reading microsoft .xls format and openoffice OpenDocument files

2008-03-10 Thread Liaw, Andy
I don't have answer to either of your questions, just some info:

1: Why not try the XLSReadWrite package that can do it natively without
using Perl to convert to CSV first?

2: There seems to be an Ooo extension that sounds similar to R-Excel
(connecting R to Calc).  Not sure if that helps you any though.

Andy 

From: Ajay Shah
> 
> 1. I have used gdata::read.xls() with much happiness. But every now
>and then it breaks. I have not, as yet, been able to construct a
>mental model about the class of .xls files for which it works. Does
>someone have a simple rule for predicting the circumstances under
>which it will work?
> 
> 2. Just like there is a read.xls(), it'd be great if we have a
>read.ods() which directly reads files from openoffice. This should
>be easier than grokking Microsoft formats given that openoffice is
>gpl. I hunted a bit and couldn't find any. Does someone know how we
>might approach this?
> 
>Am I correct in thinking that our goal is reading OpenDocument
>files (http://en.wikipedia.org/wiki/OpenDocument) ?
> 
> -- 
> Ajay Shah  
> http://www.mayin.org/ajayshah  
> [EMAIL PROTECTED] 
> http://ajayshahblog.blogspot.com
> <*(:-? - wizard who doesn't know the answer.
> 
> __
> 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.
> 
> 
> 


--
Notice:  This e-mail message, together with any attachme...{{dropped:15}}

__
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] Passing function to tapply as a string

2008-03-10 Thread Yuri Volchik

Thanks,

match.fun is what i was looking for :-)






Or perhaps:

myfun <- function(fname, ...)match.fun(fname)(...)

On 07/03/2008, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> > Was wondering if it is possible to pass function name as a parameter


-- 
View this message in context: 
http://www.nabble.com/Passing-function-to-tapply-as-a-string-tp15891151p15950836.html
Sent from the R help mailing list archive at Nabble.com.

__
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] analysing mixed effects/poisson/correlated data

2008-03-10 Thread Douglas Bates
On Sat, Mar 8, 2008 at 11:00 AM, Manuel Morales
<[EMAIL PROTECTED]> wrote:

>  On Sat, 2008-03-08 at 08:07 -0600, Douglas Bates wrote:
>  > On Sat, Mar 8, 2008 at 2:57 AM, Alexandra Bremner
>  > <[EMAIL PROTECTED]> wrote:
>  > > I am attempting to model data with the following variables:
>  >
>  > >  timepoint   - n=48, monthly over 4 years
>  > >  hospital - n=3
>  > >  opsn1 - no of outcomes
>  > >  total.patients
>  > >  skillmixpc - skill mix percentage
>  > >  nurse.hours.per.day
>  >
>  > >  Aims
>  > >  To determine if skillmix affects rate (i.e. 
> no.of.outcomes/total.patients).
>  > >  To determine if nurse.hours.per.day affects rate.
>  > >  To determine if rates vary between hospitals.
>  >
>  > >  There is first order autoregression in the data. I have attempted to 
> use the lmer function (and lmer2) with correlation structure and weights:
>  >
>  > >  test1 <-lmer(opsn1~timepoint+as.factor(hospital)+ skillmixpc + 
> nursehrsperpatday +(timepoint|hospital) 
> +offset(log(totalpats)),family=poisson, data=opsn.totals)
>  > >  test2 <-lmer(opsn1~timepoint+as.factor(hospital)+ skillmixpc + 
> nursehrsperpatday 
> +(timepoint|hospital)+offset(log(totalpats)),family=poisson, 
> data=opsn.totals, correlation=corAR1(form=~1|hospital))
>  > >  test3 <-lmer(opsn1~timepoint+as.factor(hospital)+ skillmixpc + 
> nursehrsperpatday 
> +(timepoint|hospital)+offset(log(totalpats)),family=poisson, 
> data=opsn.totals, 
> correlation=corAR1(form=~1|hospital),weights=varIdent(form=~1|hospital))
>  >
>  > You are mixing arguments for lme or nlme into a call to lmer.  Because
>  > the weigths argument doesn't have the form required by lmer you get an
>  > error message.  The effect of the correlation argument is more subtle
>  > - because lmer has ... in the argument list your correlation
>  > specification is absorbed without an error message but it has no
>  > effect.
>  >
>  > The lmer documentation doesn't say that you can use the forms of the
>  > correlation and weights arguments from the lme function, although you
>  > are not the first person to decide that it should. :-)

>  The documentation for weights in lmer references lm. It looks to me like
>  the weights argument for lm requires a vector of weights a priori - does
>  that mean lmer cannot estimate heteroscedasticity like lme can?

Yes.  lmer behaves the way that the documentation says it does.

As I indicated in my answer to Alexandra, it is not as easy as it may
seem to define what "modeling heteroscedasticity" should mean for
models like generalized linear mixed models.  Even for linear mixed
models incorporating correlation structures in addition to the
correlation in the marginal distribution of the response induced by
the random effects will frequently result in an overspecified model.

The purpose of lmer is to allow general specification of mixed-effects
models.  If someone wants to wrap the underlying representation in a
more general model specification they are free to do so.  It's open
source.

>  > There are theoretical problems with trying to specify a separate
>  > correlation argument in a generalized linear mixed model. In a GLMM
>  > the conditional variance of the response (i.e. the variance of Y given
>  > a value of B, the random effects) depends on the conditional mean so
>  > it is more difficult to decide what would be the effect if a
>  > correlation structure or a non-constant weighting structure were
>  > overlaid on it.

>  > >  Test1 & test2 give the same output (below). Does this mean that the 
> correlation structure is not being used?

>  > >  Test3 produces the following error message (I notice there are others 
> who have had problems with weights).

>  > >  Error in model.frame(formula, rownames, variables, varnames, extras, 
> extranames,  :
>  > > variable lengths differ (found for '(weights)')

>  > >  > summary(test1)
>  > >  Generalized linear mixed model fit using Laplace
>  > >
>  > >  Formula: opsn1 ~ timepoint + as.factor(hospital) + skillmixpc + 
> nursehrsperpatday +  (timepoint | hospital) + offset(log(totalpats))
>  > >
>  > >Data: opsn.totals
>  > >
>  > >   Family: poisson(log link)
>  > >
>  > >AIC   BIC logLik deviance
>  > >
>  > >   196.2 223.0 -89.12178.2
>  > >
>  > >  Random effects:
>  > >
>  > >   Groups   NameVariance   Std.Dev.   Corr
>  > >
>  > >   hospital (Intercept) 3.9993e-03 6.3240e-02
>  > >
>  > >   timepoint   5.e-10 2.2361e-05 0.000
>  > >
>  > >  number of obs: 144, groups: hospital, 3
>  > >
>  > >
>  > >
>  > >  Estimated scale (compare to  1 )  1.057574
>  > >
>  > >
>  > >
>  > >  Fixed effects:
>  > >
>  > >   Estimate Std. Error z value Pr(>|z|)
>  > >
>  > >  (Intercept)  -2.784857   1.437283 -1.9376   0.0527 .
>  > >
>  > >  timepoint-0.002806   0.002709 -1.0358   0.3003
>  > >
>  > >  as.factor(hospital)2 -0.030277   0.120896 -0.2504   0.8022
>  > >
>  > >  as.factor(hospital)3 -0.349763

Re: [R] box-constrained

2008-03-10 Thread Gustave Lefou
Hello Paul,

It is just a negative log-likelihood with two parameters belonging to [0,1]
and [0,Inf].

constrOptim is valid for all linear inequality constraints. My constraints
(box-constrained) are as simple as possible, but maybe the methods used by
constrOptim are useful too. My question is whether constrOptim is useful for
boundary problems, or if optim is sufficient for box-constrained
optimization.

Thank you.


2008/3/10, Paul Smith <[EMAIL PROTECTED]>:
>
> On Sun, Mar 9, 2008 at 9:10 PM, Gustave Lefou <[EMAIL PROTECTED]>
> wrote:
> >  I have another question.
> >
> >  I have seen there is a function called "constrOptim" in R.
> >
> >  Is it better than "optim", for example to optimize a function f of two
> >  parameters belonging to [0,1] and [0,Infinity] ? Do the methods
> >  supplied like Nelder-Mead are better than those of optim ?
>
> Could you please give us a concrete example of what you are trying to
> optimize?
>
> Paul
>
> __
> 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.


Re: [R] Reading microsoft .xls format and openoffice OpenDocument files

2008-03-10 Thread Ajay Shah
> 1: Why not try the XLSReadWrite package that can do it natively without
> using Perl to convert to CSV first?

I looked at the package (it's
http://cran.r-project.org/web/packages/xlsReadWrite/index.html) but
it's windows only. So no joy yet.

> 2: There seems to be an Ooo extension that sounds similar to R-Excel
> (connecting R to Calc).  Not sure if that helps you any though.

I wasn't able to locate this. Could you please describe this further?

-- 
Ajay Shah  http://www.mayin.org/ajayshah  
[EMAIL PROTECTED] http://ajayshahblog.blogspot.com
<*(:-? - wizard who doesn't know the answer.

__
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] Passing function to tapply as a string

2008-03-10 Thread Gabor Grothendieck
Also note that there is match.funfn in the gsubfn package.  That allows
you to also pass functions defined as formulas:

e.g.

library(gsubfn)
f.at.four <- function(f) match.funfn(f)(4)

f.at.four(sqrt) # 2
f.at.four("sqrt") # 2
f.at.four(~ x^.5) # 2 - uses function(x) x^.5

See homepage, ?match.funfn and the vignette.

On Mon, Mar 10, 2008 at 11:46 AM, Yuri Volchik <[EMAIL PROTECTED]> wrote:
>
> Thanks,
>
> match.fun is what i was looking for :-)
>
>
>
>
>
>
> Or perhaps:
>
> myfun <- function(fname, ...)match.fun(fname)(...)
>
> On 07/03/2008, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> > > Was wondering if it is possible to pass function name as a parameter
>
>
> --
> View this message in context: 
> http://www.nabble.com/Passing-function-to-tapply-as-a-string-tp15891151p15950836.html
> Sent from the R help mailing list archive at Nabble.com.
>
> __
>
> 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-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] caretNWS and training data set sizes

2008-03-10 Thread Tait, Peter
Hi,

I am using the caretNWS package to train some supervised regression models 
(gbm, lasso, random forest and mars). The problem I have encountered started 
when my training data set increased in the number of predictors and the number 
of observations.

The training data set has 347 numeric columns. The problem I have is when there 
are more then 2500 observations the 5 sleigh objects start but do not use any 
CPU resources and do not process any data.

N=100 cpu(%)   memory(K)
Rgui.exe   0   91737
5x sleighs (RTerm.exe)15-25 ~27000

N=2500
Rgui.exe  0 16
5x sleighs (RTerm.exe)15-25 ~74000

N=5000
Rgui.exe  50 193000
5x sleighs (RTerm.exe)0 ~19000


A 10% sample of my overall data is ~22000 observations.

Can someone give me an idea of the limitations of the nws and caretNWS packages 
in terms of the number of columns and rows of the training matrices and if 
there are other tuning/training functions that work faster on large datasets?

Thanks for your help.
Peter


> version
   _
platform   i386-pc-mingw32
arch   i386
os mingw32
system i386, mingw32
status
major  2
minor  6.2
year   2008
month  02
day08
svn rev44383
language   R
version.string R version 2.6.2 (2008-02-08)

> memory.limit()
[1] 2047

__
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] Reading microsoft .xls format and openoffice OpenDocument files

2008-03-10 Thread Gabor Grothendieck
With regards to #1 you could also check out
http://tolstoy.newcastle.edu.au/R/help/06/04/25674.html

On Fri, Mar 7, 2008 at 7:17 AM, Ajay Shah <[EMAIL PROTECTED]> wrote:
> 1. I have used gdata::read.xls() with much happiness. But every now
>   and then it breaks. I have not, as yet, been able to construct a
>   mental model about the class of .xls files for which it works. Does
>   someone have a simple rule for predicting the circumstances under
>   which it will work?
>
> 2. Just like there is a read.xls(), it'd be great if we have a
>   read.ods() which directly reads files from openoffice. This should
>   be easier than grokking Microsoft formats given that openoffice is
>   gpl. I hunted a bit and couldn't find any. Does someone know how we
>   might approach this?
>
>   Am I correct in thinking that our goal is reading OpenDocument
>   files (http://en.wikipedia.org/wiki/OpenDocument) ?
>
> --
> Ajay Shah  http://www.mayin.org/ajayshah
> [EMAIL PROTECTED] http://ajayshahblog.blogspot.com
> <*(:-? - wizard who doesn't know the answer.
>
> __
> 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-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] Tinn-R related problem

2008-03-10 Thread David Hewitt



> A few weeks ago all of a sudden the backspace, enter and direction keys
> were not working. I updated Tinn-R to the newest version but still no
> sollution. After this I tried reinstalling it (prior to that I removed
> Tinn-R and deleted all the "leftovers" manually) and still no change. In
> every other execution (e.g. when I save a file) every key works fine.
> 

I've used Tinn-R with R on Win XP ever since I started with R, and I've
never had this problem. The only immediate thing that comes to mind is that
you should be installing R in SDI mode to get it working with Tinn-R. At
least that's what they say, and I've never tried it the other way (MDI).
Maybe just uninstall R and Tinn-R, then reload R, use Custom installation
and pick SDI, then reinstall Tinn-R. Worth a shot.



> From what I have read in the other forums I believe this issue is not
> necessarily R or Tinn-R related but might be some hidden Windows settings
> (I'm using XP) but of this I'm not sure.
> 

If that's the case, I can't help. What occurred "a few weeks ago" that might
have been related? Did you upgrade R?


-
David Hewitt
Virginia Institute of Marine Science
http://www.vims.edu/fish/students/dhewitt/
-- 
View this message in context: 
http://www.nabble.com/Tinn-R-related-problem-tp15950714p15950865.html
Sent from the R help mailing list archive at Nabble.com.

__
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] re moving parentheses/square brackets from data frame numbers

2008-03-10 Thread Charles C. Berry
On Mon, 10 Mar 2008, Thomsen wrote:

>
> Dear list,
>
> I am importing data consisting of numbers into dataframes. Some of the
> numbers are flanked by parentheses or square brackets. Thus, they are not
> recognized as numeric and the corresponding column is of class "factor"
> which makes it hard/impossible use in plotting functions.
>
> Is there a way to remove brackets from numbers in a column/row/dataframe?


Oh yes!

But you have not followed this dictum

 provide commented, minimal, self-contained, reproducible code


so we can't suggest specific solutions.

Suggest you see

?gsub
?regexp

HTH,

Chuck

>
> Kind regards,
>
> Stefan
> -- 
> View this message in context: 
> http://www.nabble.com/removing-parentheses-square-brackets-from-data-frame-numbers-tp15950774p15950774.html
> Sent from the R help mailing list archive at Nabble.com.
>
> __
> 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.
>

Charles C. Berry(858) 534-2098
 Dept of Family/Preventive Medicine
E mailto:[EMAIL PROTECTED]  UC San Diego
http://famprevmed.ucsd.edu/faculty/cberry/  La Jolla, San Diego 92093-0901

__
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] 3D projection pursuit

2008-03-10 Thread giovanna menardi

Hi,
 
is there any R function or package aimed at finding 3D projection pursuit 
solutions? I was able to find only interactive 2D projection pursuit in Rggobi.
Thanks in advance,
Giovanna
_
[[elided Hotmail spam]]

[[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.


Re: [R] Reading microsoft .xls format and openoffice OpenDocument files

2008-03-10 Thread Liaw, Andy
From: Ajay Shah
 
> > 1: Why not try the XLSReadWrite package that can do it 
> natively without
> > using Perl to convert to CSV first?
> 
> I looked at the package (it's
> http://cran.r-project.org/web/packages/xlsReadWrite/index.html) but
> it's windows only. So no joy yet.
> 
> > 2: There seems to be an Ooo extension that sounds similar to R-Excel
> > (connecting R to Calc).  Not sure if that helps you any though.
> 
> I wasn't able to locate this. Could you please describe this further?

See http://extensions.services.openoffice.org/project/R4Calc.
Looks hot out of the oven.  I happened to see it when browsing through
the list of Ooo extensions while waiting for Ooo 2.3.1 to download last
night.

Andy

 
> -- 
> Ajay Shah  
> http://www.mayin.org/ajayshah  
> [EMAIL PROTECTED] 
> http://ajayshahblog.blogspot.com
> <*(:-? - wizard who doesn't know the answer.
> 
> __
> 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.
> 
> 
> 


--
Notice:  This e-mail message, together with any attachme...{{dropped:15}}

__
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] caretNWS and training data set sizes

2008-03-10 Thread Max Kuhn
What version of caret and caretNWS are you using? Also, what version
of the nws server and twisted are you using? What kind of machine (#
processors, how much physical memory etc)?

I haven't seen any real limitations with one exception: if you are
running P jobs on the same machine, you are replicating the memory
needs P times.

I've been running jobs with 4K to 90K samples and 1200 predictors
without issues, so I'll need a lot more information to help you.

Max


On Mon, Mar 10, 2008 at 12:04 PM, Tait, Peter <[EMAIL PROTECTED]> wrote:
> Hi,
>
>  I am using the caretNWS package to train some supervised regression models 
> (gbm, lasso, random forest and mars). The problem I have encountered started 
> when my training data set increased in the number of predictors and the 
> number of observations.
>
>  The training data set has 347 numeric columns. The problem I have is when 
> there are more then 2500 observations the 5 sleigh objects start but do not 
> use any CPU resources and do not process any data.
>
>  N=100 cpu(%)   memory(K)
>  Rgui.exe   0   91737
>  5x sleighs (RTerm.exe)15-25 ~27000
>
>  N=2500
>  Rgui.exe  0 16
>  5x sleighs (RTerm.exe)15-25 ~74000
>
>  N=5000
>  Rgui.exe  50 193000
>  5x sleighs (RTerm.exe)0 ~19000
>
>
>  A 10% sample of my overall data is ~22000 observations.
>
>  Can someone give me an idea of the limitations of the nws and caretNWS 
> packages in terms of the number of columns and rows of the training matrices 
> and if there are other tuning/training functions that work faster on large 
> datasets?
>
>  Thanks for your help.
>  Peter
>
>
>  > version
>_
>  platform   i386-pc-mingw32
>  arch   i386
>  os mingw32
>  system i386, mingw32
>  status
>  major  2
>  minor  6.2
>  year   2008
>  month  02
>  day08
>  svn rev44383
>  language   R
>  version.string R version 2.6.2 (2008-02-08)
>
>  > memory.limit()
>  [1] 2047
>
>  __
>  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.
>



-- 

Max

__
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] draw partition lines

2008-03-10 Thread Greg Snow
Here is one approach (you can adapt as needed):

library(TeachingDemos)

par(mfrow=c(4,2))

plot(1:10)
plot(10:1)
plot(c(1:5,5:1))
plot(c(5:1,1:5))

tmp <- cnvrt.coords(1,0, input='fig')$usr # get right end coord
tmp2 <- cnvrt.coords(0,NA, input='tdev')$usr # get left end 
par(xpd=NA) # turn off clipping
segments(tmp$x,tmp$y,tmp2$x,tmp$y, col='blue')

hist(rnorm(10))
hist(rnorm(100))
hist(rnorm(3))
hist(rnorm(1))

Hope this helps,

-- 
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
[EMAIL PROTECTED]
(801) 408-8111
 
 

> -Original Message-
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of questions?
> Sent: Saturday, March 08, 2008 4:44 PM
> To: r-help@r-project.org
> Subject: [R] draw partition lines
> 
> I am using par(mfrow(4,2)...) to plot multiple graphs in one frame.
> However, the plots naturally partitioned into two sets, the 
> first two rows and the 3rd and 4th row are slightly 
> different, I want them to be in one frame, but I also want to 
> draw a line (or something to make top two rows/bottom two 
> rows look slightly
> different) in between them?
> 
> Any suggestions?
> 
> 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-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] Model confusion

2008-03-10 Thread Christopher De Ang

Hi,
 
I m wondering is there any rules on what variables are used for factor 
analysis/ loading. For instance, increase reputation lead to increase in volume 
of post. So is volume need to be calculated in factor loading.
 
 
InDependent Variable dependent Variables
reputation >Volume (based on the no. of posting)
social interaction ties ->Volume
 
Anyway, when i load it, it give me a eigenvalue of 0.999 .what to do about 
it.
 
Thanks,
Christopher
_


[[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] ML Estimation Differences with R and SAS

2008-03-10 Thread Patrick Richardson
List,

I'm working on fitting a logistic model for a well known dataset (which is
given below in case anyone wants to try to reproduce).  I used both R and
SAS to fit the model and have some differences in the parameter estimates.
I'm wondering if R calculates the ML estimates differently.  I'm making NO
accusations as to which program is "right or wrong".  That is not the focus
of this posting.  As a "newer" R user I'm trying to understand the algorithm
that R might use to calculate ML estimation.  The largest difference seems
to with the race factors.  R gives a p-value of 0.46995 for race=black and
SAS gives a p-value of 0.0753 for race=black.  Clearly one is borderline
significant and the other is not.  Many thanks to all who might be able to
offer any insight on this.  Both R and SAS code and output are included in
this message (along with the dataset).

Thanks,

Patrick


MY R CODE IS:

Dataset <- read.table("", header=TRUE, sep="", na.strings="NA",
dec=".", strip.white=TRUE)
Dataset$race <- factor(Dataset$race, levels=c('other','black','white'))
GLM.1 <- glm(low  ~ lwt  + ptl  + ht  + race  + smoke ,
family=binomial(logit), data=Dataset)
summary(GLM.1)

MY SAS CODE IS:

PROC LOGISTIC descending DATA=p2;
class race (ref='other');
MODEL LOW = lwt ptl ht race smoke / lackfit parmlabel expb link=logit;
RUN;

MY R OUTPUT IS:

Coefficients:
  Estimate Std. Error z value Pr(>|z|)   
(Intercept)0.926190.85549   1.083  0.27897   
lwt   -0.016500.00692  -2.384  0.01712 * 
ptl1.231160.44607   2.760  0.00578 **
ht 1.761970.70748   2.490  0.01276 * 
race[T.black]  0.395520.54739   0.723  0.46995   
race[T.white] -0.862910.43517  -1.983  0.04737 * 
smoke  0.880070.40049   2.197  0.02798 * 
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 

(Dispersion parameter for binomial family taken to be 1)

Null deviance: 234.67  on 188  degrees of freedom
Residual deviance: 200.62  on 182  degrees of freedom
AIC: 214.62

Number of Fisher Scoring iterations: 4

MY SAS OUTPUT IS:

  The LOGISTIC Procedure

   Analysis of Maximum Likelihood Estimates

 StandardWald
  ParameterDF  Estimate Error  Chi-Square  Pr > ChiSq  Exp(Est)
Label

  Intercept 10.92870.9326  0.9916  0.3193 2.531
Intercept: low=1
  lwt   1   -0.0173   0.00699  6.1425  0.0132 0.983
  ptl   11.19580.4472  7.1493  0.0075 3.306
  ht11.74820.7090  6.0805  0.0137 5.745
  race  black   10.59630.3352  3.1643  0.0753 1.815
race black
  race  white   1   -0.72000.2668  7.2803  0.0070 0.487
race white
  smoke 10.86480.4009  4.6534  0.0310 2.375





0 19 182 black 0 0 1 0 0 2523
0 33 155 other 0 0 0 1 0 2551
0 20 105 white 1 0 0 1 0 2557
0 21 108 white 1 0 1 1 0 2594
0 18 107 white 1 0 1 0 0 2600
0 21 124 other 0 0 0 0 0 2622
0 22 118 white 0 0 0 1 0 2637
0 17 103 other 0 0 0 1 0 2637
0 29 123 white 1 0 0 1 0 2663
0 26 113 white 1 0 0 0 0 2665
0 19 95  other 0 0 0 0 0 2722
0 19 150 other 0 0 0 1 0 2733
0 22 95  other 0 1 0 0 0 2750
0 30 107 other 0 0 1 1 1 2750
0 18 100 white 1 0 0 0 0 2769
0 15 98  black 0 0 0 0 0 2778
0 25 118 white 1 0 0 1 0 2782
0 20 120 other 0 0 1 0 0 2807
0 28 120 white 1 0 0 1 0 2821
0 32 101 other 0 0 0 1 0 2835
0 31 100 white 0 0 1 1 0 2835
0 36 202 white 0 0 0 1 0 2836
0 28 120 other 0 0 0 0 0 2863
0 25 120 other 0 0 1 1 0 2877
0 28 167 white 0 0 0 0 0 2877
0 17 122 white 1 0 0 0 0 2906
0 29 150 white 0 0 0 1 0 2920
0 26 168 black 1 0 0 0 0 2920
0 17 113 black 0 0 0 1 0 2920
0 24 90  white 1 0 0 1 1 2948
0 35 121 black 1 0 0 1 1 2948
0 

Re: [R] caretNWS and training data set sizes

2008-03-10 Thread Tait, Peter
Hi Max,
Thank you for the fast response.

Here are the versions of the R packages I am using:

caret 3.13
caretNWS 0.16
nws 1.62

Here are the python versions

Active Python 2.5.1.1
nws server 1.5.2 for py2.5
twisted 2.5.9 py2.5

The computer I am using has 1 Xeon dual core cpu at 1.86 GHz with 4 GB of RAM. 
R is currently set up to use 2 GB of it (it starts with "C:\Program 
Files\R\R-2.6.2\bin\Rgui.exe" --max-mem-size=2047M). The OS is Windows Server 
2003 R2 with SP2.

I am running one R job/process (Rgui.exe) and almost nothing else on the 
computer while R is running (no databases, web servers, office apps etc..)

I really appreciate your help.
Cheers
Peter


>-Original Message-
>From: Max Kuhn [mailto:[EMAIL PROTECTED]
>Sent: Monday, March 10, 2008 12:41 PM
>To: Tait, Peter
>Cc: r-help@R-project.org
>Subject: Re: [R] caretNWS and training data set sizes
>
>What version of caret and caretNWS are you using? Also, what version
>of the nws server and twisted are you using? What kind of machine (#
>processors, how much physical memory etc)?
>
>I haven't seen any real limitations with one exception: if you are
>running P jobs on the same machine, you are replicating the memory
>needs P times.
>
>I've been running jobs with 4K to 90K samples and 1200 predictors
>without issues, so I'll need a lot more information to help you.
>
>Max
>
>
>On Mon, Mar 10, 2008 at 12:04 PM, Tait, Peter <[EMAIL PROTECTED]> wrote:
>> Hi,
>>
>>  I am using the caretNWS package to train some supervised regression
>models (gbm, lasso, random forest and mars). The problem I have encountered
>started when my training data set increased in the number of predictors and
>the number of observations.
>>
>>  The training data set has 347 numeric columns. The problem I have is
>when there are more then 2500 observations the 5 sleigh objects start but
>do not use any CPU resources and do not process any data.
>>
>>  N=100 cpu(%)   memory(K)
>>  Rgui.exe   0   91737
>>  5x sleighs (RTerm.exe)15-25 ~27000
>>
>>  N=2500
>>  Rgui.exe  0 16
>>  5x sleighs (RTerm.exe)15-25 ~74000
>>
>>  N=5000
>>  Rgui.exe  50 193000
>>  5x sleighs (RTerm.exe)0 ~19000
>>
>>
>>  A 10% sample of my overall data is ~22000 observations.
>>
>>  Can someone give me an idea of the limitations of the nws and caretNWS
>packages in terms of the number of columns and rows of the training
>matrices and if there are other tuning/training functions that work faster
>on large datasets?
>>
>>  Thanks for your help.
>>  Peter
>>
>>
>>  > version
>>_
>>  platform   i386-pc-mingw32
>>  arch   i386
>>  os mingw32
>>  system i386, mingw32
>>  status
>>  major  2
>>  minor  6.2
>>  year   2008
>>  month  02
>>  day08
>>  svn rev44383
>>  language   R
>>  version.string R version 2.6.2 (2008-02-08)
>>
>>  > memory.limit()
>>  [1] 2047
>>
>>  __
>>  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.
>>
>
>
>
>--
>
>Max

__
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] reorder x-axis

2008-03-10 Thread stephen sefick
read.table("bug.txt", header=TRUE)
plotMeans(bug$tot, bug$station, error.bars="se", main="Total")

The plot is ordered in this way HC RM190 RM198 RM202.
I would like it to plot in this way HC RM202 RM198 RM190.

thanks
Stephen

Is this okay or would you like the data to be copied and pasted into
the message body.  I am trying to optimize my postings.

-- 
Let's not spend our time and resources thinking about things that are
so little or so large that all they really do for us is puff us up and
make us feel like gods.  We are mammals, and have not exhausted the
annoying little problems of being mammals.

-K. Mullis
station month   bas
RM190   5   0.000
RM190   7   1.563
RM190   10  0.000
RM190   11  0.000
RM202   4   18.750
RM202   5   18.750
RM202   7   6.250
RM202   10  4.800
RM202   11  3.125
RM198   4   18.750
RM198   5   31.250
RM198   7   3.125
RM198   10  3.200
RM198   11  12.500
HC  4   0.000
HC  5   0.000
HC  7   0.000
HC  10  0.000
HC  11  0.000
__
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] gam - Extraction of nonparametric component

2008-03-10 Thread Wensui Liu
i could remember exactly but it is like something: components <-
predict(gam.object, type = "terms")

On Mon, Mar 10, 2008 at 1:36 PM, Michael A. Milligan <[EMAIL PROTECTED]> wrote:
> Hello,
>
>  I am estimating a semiparametric partial linear model
>  using gam of the form
>
>  y=f1(x1)+f2(x2)+beta*X
>
>  where y is the dependent variable, f1(x1) and f2(x2)
>  are nonparametric functions of the independent
>  variables x1 and x2, respectively, and beta and X are
>  vectors of coefficients and independent variables.
>  The R code is
>
>  EqGamAS <-  gam(y ~ X+s(x1)+s(x2))
>
>  My question is, how can I extract the fitted values
>  of, say, f1(x1)?  Of course fitted(EqGamAS) returns
>  the fitted values of the entire regression function,
>  but is there a way to view only one component of the
>  nonparametric part of the estimation?  I have looked
>  through documentation and help archives and have not
>  found the answer.  I appreciate very much any help
>  anyone can give me.
>
>  Michael Milligan
>  Doctoral Candidate
>  University of New Mexico
>
>
>   
> 
>  Be a better friend, newshound, and
>
>  __
>  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.
>



-- 
===
WenSui Liu
ChoicePoint Precision Marketing
Phone: 678-893-9457
Email : [EMAIL PROTECTED]
Blog   : statcompute.spaces.live.com

__
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] caretNWS and training data set sizes

2008-03-10 Thread Max Kuhn
Peter,

You are certainly up to date. Can you try replicating this using only
two nodes (since you only have two processors)? I'm not sure that
specifying 5 really helps. Using 2 nodes on my mac usually gets me
about a 30-40% decrease in time.

Also, are the processes just hanging or is there an error? These
models may take a while. Perhaps testing with pls, lm or some other
fast model might help troubleshoot.

If you are not passing a sleigh object into the trainNWS call, you can
do this by using

trainNWSControl(
 start = makeSleighStarter(workerCount = 2))

The only other thing I can suggest is to send me the data (or an
anonymized knock-off) so that I can test. You certainly should be able
to do this, but you may be limited by your machine.

Max

On Mon, Mar 10, 2008 at 1:18 PM, Tait, Peter <[EMAIL PROTECTED]> wrote:
> Hi Max,
>  Thank you for the fast response.
>
>  Here are the versions of the R packages I am using:
>
>  caret 3.13
>  caretNWS 0.16
>  nws 1.62
>
>  Here are the python versions
>
>  Active Python 2.5.1.1
>  nws server 1.5.2 for py2.5
>  twisted 2.5.9 py2.5
>
>  The computer I am using has 1 Xeon dual core cpu at 1.86 GHz with 4 GB of 
> RAM. R is currently set up to use 2 GB of it (it starts with "C:\Program 
> Files\R\R-2.6.2\bin\Rgui.exe" --max-mem-size=2047M). The OS is Windows Server 
> 2003 R2 with SP2.
>
>  I am running one R job/process (Rgui.exe) and almost nothing else on the 
> computer while R is running (no databases, web servers, office apps etc..)
>
>  I really appreciate your help.
>  Cheers
>  Peter
>
>
>
>
>  >-Original Message-
>  >From: Max Kuhn [mailto:[EMAIL PROTECTED]
>  >Sent: Monday, March 10, 2008 12:41 PM
>  >To: Tait, Peter
>  >Cc: r-help@R-project.org
>  >Subject: Re: [R] caretNWS and training data set sizes
>  >
>  >What version of caret and caretNWS are you using? Also, what version
>  >of the nws server and twisted are you using? What kind of machine (#
>  >processors, how much physical memory etc)?
>  >
>  >I haven't seen any real limitations with one exception: if you are
>  >running P jobs on the same machine, you are replicating the memory
>  >needs P times.
>  >
>  >I've been running jobs with 4K to 90K samples and 1200 predictors
>  >without issues, so I'll need a lot more information to help you.
>  >
>  >Max
>  >
>  >
>  >On Mon, Mar 10, 2008 at 12:04 PM, Tait, Peter <[EMAIL PROTECTED]> wrote:
>  >> Hi,
>  >>
>  >>  I am using the caretNWS package to train some supervised regression
>  >models (gbm, lasso, random forest and mars). The problem I have encountered
>  >started when my training data set increased in the number of predictors and
>  >the number of observations.
>  >>
>  >>  The training data set has 347 numeric columns. The problem I have is
>  >when there are more then 2500 observations the 5 sleigh objects start but
>  >do not use any CPU resources and do not process any data.
>  >>
>  >>  N=100 cpu(%)   memory(K)
>  >>  Rgui.exe   0   91737
>  >>  5x sleighs (RTerm.exe)15-25 ~27000
>  >>
>  >>  N=2500
>  >>  Rgui.exe  0 16
>  >>  5x sleighs (RTerm.exe)15-25 ~74000
>  >>
>  >>  N=5000
>  >>  Rgui.exe  50 193000
>  >>  5x sleighs (RTerm.exe)0 ~19000
>  >>
>  >>
>  >>  A 10% sample of my overall data is ~22000 observations.
>  >>
>  >>  Can someone give me an idea of the limitations of the nws and caretNWS
>  >packages in terms of the number of columns and rows of the training
>  >matrices and if there are other tuning/training functions that work faster
>  >on large datasets?
>  >>
>  >>  Thanks for your help.
>  >>  Peter
>  >>
>  >>
>  >>  > version
>  >>_
>  >>  platform   i386-pc-mingw32
>  >>  arch   i386
>  >>  os mingw32
>  >>  system i386, mingw32
>  >>  status
>  >>  major  2
>  >>  minor  6.2
>  >>  year   2008
>  >>  month  02
>  >>  day08
>  >>  svn rev44383
>  >>  language   R
>  >>  version.string R version 2.6.2 (2008-02-08)
>  >>
>  >>  > memory.limit()
>  >>  [1] 2047
>  >>
>  >>  __
>  >>  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.
>  >>
>  >
>  >
>  >
>  >--
>  >
>  >Max
>



-- 

Max

__
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] gam - Extraction of nonparametric component

2008-03-10 Thread Michael A. Milligan
Hello,

I am estimating a semiparametric partial linear model
using gam of the form

y=f1(x1)+f2(x2)+beta*X

where y is the dependent variable, f1(x1) and f2(x2)
are nonparametric functions of the independent
variables x1 and x2, respectively, and beta and X are
vectors of coefficients and independent variables. 
The R code is

EqGamAS <-  gam(y ~ X+s(x1)+s(x2))

My question is, how can I extract the fitted values
of, say, f1(x1)?  Of course fitted(EqGamAS) returns
the fitted values of the entire regression function,
but is there a way to view only one component of the
nonparametric part of the estimation?  I have looked
through documentation and help archives and have not
found the answer.  I appreciate very much any help
anyone can give me.

Michael Milligan
Doctoral Candidate
University of New Mexico


  

Be a better friend, newshound, and

__
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] When to quote a package name

2008-03-10 Thread Muenchen, Robert A (Bob)
Dear HelpeRs,

I'm confused about the role of quotes around package names on the
library and detach functions. Books on R use both approaches:

library(Hmisc)
describe(mydata)
detach(package:Hmisc)

and

library("Hmisc")
describe(mydata)
detach("package:Hmisc")

The help file for detach says "quoted or unquoted" and the help file for
library says about the package, "the name of a package, given as a name
or literal character string, or a character string, depending on whether
character.only is FALSE (default) or TRUE)."

Are there conditions under which it matters? Which is best?

Thanks,
Bob

=
Bob Muenchen (pronounced Min'-chen), 
Manager, Statistical Consulting Center 
U of TN Office of Information Technology
Stokely Management Center, Suite 200
916 Volunteer Blvd., Knoxville, TN 37996-0520
Voice: (865) 974-5230
FAX: (865) 974-4810
Email: [EMAIL PROTECTED]
Web: http://oit.utk.edu/scc
Map: http://www.utk.edu/maps 
News: http://listserv.utk.edu/archives/statnews.html
=

__
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] When to quote a package name

2008-03-10 Thread Uwe Ligges


Muenchen, Robert A (Bob) wrote:
> Dear HelpeRs,
> 
> I'm confused about the role of quotes around package names on the
> library and detach functions. Books on R use both approaches:
> 
> library(Hmisc)
> describe(mydata)
> detach(package:Hmisc)
> 
> and
> 
> library("Hmisc")
> describe(mydata)
> detach("package:Hmisc")
> 
> The help file for detach says "quoted or unquoted" and the help file for
> library says about the package, "the name of a package, given as a name
> or literal character string, or a character string, depending on whether
> character.only is FALSE (default) or TRUE)."
> 
> Are there conditions under which it matters? Which is best?
> 

The cleaner approach is to use quotes. I'd expect

x <- "Hmisc"
library(x)

to install package "Hmisc", but not package "x"...
In fact, it also installs "x" (as documented), unfortunately.

Uwe Ligges



> Thanks,
> Bob
> 
> =
> Bob Muenchen (pronounced Min'-chen), 
> Manager, Statistical Consulting Center 
> U of TN Office of Information Technology
> Stokely Management Center, Suite 200
> 916 Volunteer Blvd., Knoxville, TN 37996-0520
> Voice: (865) 974-5230
> FAX: (865) 974-4810
> Email: [EMAIL PROTECTED]
> Web: http://oit.utk.edu/scc
> Map: http://www.utk.edu/maps 
> News: http://listserv.utk.edu/archives/statnews.html
> =
> 
> __
> 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-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] plotting multiple lines in 3d

2008-03-10 Thread stephen sefick
I have been looking around for packages that will do this but I am not
stumbling on the right one.  I would like to make a 3d plot (hopefully
an interactive graphic (rgl maybe)) that is simply four 2d graphs
stacked next to each other traveling down river.  site is the x-axis,
bas is the y-axis, and month is the z axis.  I would be open to any
other suggestions on how to  visualize this date

station month   bas
190 5   0.000
190 7   1.563
190 10  0.000
190 11  0.000
202 4   18.750
202 5   18.750
202 7   6.250
202 10  4.800
202 11  3.125
198 4   18.750
198 5   31.250
198 7   3.125
198 10  3.200
198 11  12.500
205 4   0.000
205 5   0.000
205 7   0.000
205 10  0.000
205 11  0.000

thanks

Stephen

-- 
Let's not spend our time and resources thinking about things that are
so little or so large that all they really do for us is puff us up and
make us feel like gods.  We are mammals, and have not exhausted the
annoying little problems of being mammals.

-K. Mullis

__
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] ML Estimation Differences with R and SAS

2008-03-10 Thread Rolf Turner

On 11/03/2008, at 6:09 AM, Patrick Richardson wrote:

> List,
>
> I'm working on fitting a logistic model for a well known dataset  
> (which is
> given below in case anyone wants to try to reproduce).  I used both  
> R and
> SAS to fit the model and have some differences in the parameter  
> estimates.
> I'm wondering if R calculates the ML estimates differently.  I'm  
> making NO
> accusations as to which program is "right or wrong".  That is not  
> the focus
> of this posting.  As a "newer" R user I'm trying to understand the  
> algorithm
> that R might use to calculate ML estimation.  The largest  
> difference seems
> to with the race factors.  R gives a p-value of 0.46995 for  
> race=black and
> SAS gives a p-value of 0.0753 for race=black.  Clearly one is  
> borderline
> significant and the other is not.  Many thanks to all who might be  
> able to
> offer any insight on this.  Both R and SAS code and output are  
> included in
> this message (along with the dataset).

Try setting

options(contrasts=c("contr.SAS","contr.poly"))

before you run your analysis in R.

cheers,

Rolf Turner

##
Attention:\ This e-mail message is privileged and confid...{{dropped:9}}

__
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] Mimicking SPSS weighted least squares

2008-03-10 Thread Rolf Turner

On 11/03/2008, at 4:04 AM, Ben Domingue wrote:

> Howdy,
> In SPSS, there are 2 ways to weight a least squares regression:
> 1. You can do it from the regression menu.
> 2. You can set a global weight switch from the data menu.
> These two options have no, in my experience, been equivalent.
> Now, when I run lm in R with the weights= switch set accordingly, I
> get the same set of results you would see with option #1 in SPSS.
> Does anybody know how to duplicate option #2 from SPSS in R?

I think it's up to you to find out what ``option #2 from SPSS'' actually
*does*.  If you know that, then you can (with a modicum of effort)
duplicate that option in R.  The help file for lm() tells you that
R uses the weights by minimizing sum(w*e^2) where w = weights and
e = ``errors'' or residuals.

cheers,

Rolf Turner

##
Attention:\ This e-mail message is privileged and confid...{{dropped:9}}

__
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] Reading microsoft .xls format and openoffice OpenDocument files

2008-03-10 Thread Gregory Warnes
Hello Ajay,

I'm the author of the gdata package.  If you send me a copy of  
an .XLS file that doesn't work with read.xls(), I'll see about fixing  
the code.

-Greg




On Mar 7, 2008, at 6:17AM , Ajay Shah wrote:

> 1. I have used gdata::read.xls() with much happiness. But every now
>and then it breaks. I have not, as yet, been able to construct a
>mental model about the class of .xls files for which it works. Does
>someone have a simple rule for predicting the circumstances under
>which it will work?
>
> 2. Just like there is a read.xls(), it'd be great if we have a
>read.ods() which directly reads files from openoffice. This should
>be easier than grokking Microsoft formats given that openoffice is
>gpl. I hunted a bit and couldn't find any. Does someone know how we
>might approach this?
>
>Am I correct in thinking that our goal is reading OpenDocument
>files (http://en.wikipedia.org/wiki/OpenDocument) ?
>
> -- 
> Ajay Shah  http://www.mayin.org/ 
> ajayshah
> [EMAIL PROTECTED] http:// 
> ajayshahblog.blogspot.com
> <*(:-? - wizard who doesn't know the answer.
>
> __
> 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-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] state space model for poisson distribution

2008-03-10 Thread arun kirshna
Hi Rers,

I have a poission time series model with 5 parameters.   I just wanted to  
remove two  of the lag on response in the model and put it as a system model.  
I am not sure about the codes to combine these  two on R.  If anybody has any R 
example (code), please post it.

My original model: 
log(Y(t))~constant+b1*Y(t-1)+b2*Y(t-2)+b3*(variable1)+b4*(variable2)+e
I would like to construct a model:
log(Y(t))~constant+b1*(variable1)+b2*(variable2)+X(t)

X(t)~phi1*Xt-1+phi2*Xt-2+error

where X(t) is the autoregressive lag effect of response.

A.K.




   
-

[[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] combining/deleting rows

2008-03-10 Thread Suran, Luciana @ Torto Wheaton Research
Hello List,

 

I'm new to R and have some question on combining (and deleting) rows. 

 

I have a dataset that looks like this: 

 

 

msa_id

base_sf.2002.2

compltns.2002.2

absorption.2002.2

avrate.2002.2

1

AKRON

27918

0

-1420

19

24

ALBUQU

20469

77

-23

9.2

100

ALLENT

41490

0

-208

19

129

AARBOR

6264

0

62

18

178

ATLANT

395974

1486

638

16.6

254

AUSTIN

34000

31

153

15

330

BALTIM

121080

361

-3447

17.7

 

 

How can I add row 1 to row 24? Also, how can I delete rows from the
dataframe?

 

 

Thanks so much in advance,

Luciana

 

Luciana Suran | Economist  

CBRE Torto Wheaton Research | Research 

200 High Street, 3rd Floor | Boston, MA 02110 

T 617 912 5204 | F 617 912 5240 

[EMAIL PROTECTED] | www.tortowheatonresearch.com 

 

Please consider the environment before printing this email. 

 

This email may contain information that is confidential or
attorney-client privileged and may constitute inside information. The
contents of this email are intended only for the recipient(s) listed
above. If you are not the intended recipient, you are directed not to
read, disclose, distribute or otherwise use this transmission. If you
have received this email in error, please notify the sender immediately
and delete the transmission. Delivery of this message is not intended to
waive any applicable privileges.

 

 


[[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] Help on display of labels

2008-03-10 Thread Murthy S. Vanapalli
Hello all -

I am a newbie and trying to figure out how to display all the labels of the
regression tree, in a meaningful way. Yes, I have some long labels.

# plot tree
plot(fit, uniform=TRUE,main="Regression Tree for PVDecayData")
text(fit, use.n=TRUE, all=TRUE, cex=.8)

Results in the output that is attached to this email.

Any help greatly appreciated.

Regards,
Murthy


PVDecayData.pdf
Description: Adobe PDF document
__
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] box-constrained

2008-03-10 Thread Paul Smith
On Mon, Mar 10, 2008 at 4:02 PM, Gustave Lefou <[EMAIL PROTECTED]> wrote:
> It is just a negative log-likelihood with two parameters belonging to [0,1]
> and [0,Inf].
>
> constrOptim is valid for all linear inequality constraints. My constraints
> (box-constrained) are as simple as possible, but maybe the methods used by
> constrOptim are useful too. My question is whether constrOptim is useful for
> boundary problems, or if optim is sufficient for box-constrained
> optimization.

Gustave,

It would be useful if you gave us a concrete function (with its
functional form defined) as an example.

Paul






> 2008/3/10, Paul Smith <[EMAIL PROTECTED]>:
> >
> >
> >
> > On Sun, Mar 9, 2008 at 9:10 PM, Gustave Lefou <[EMAIL PROTECTED]>
> wrote:
> > >  I have another question.
> > >
> > >  I have seen there is a function called "constrOptim" in R.
> > >
> > >  Is it better than "optim", for example to optimize a function f of two
> > >  parameters belonging to [0,1] and [0,Infinity] ? Do the methods
> > >  supplied like Nelder-Mead are better than those of optim ?
> >
> > Could you please give us a concrete example of what you are trying to
> optimize?
> >
> > Paul
> >
> >
> > __
> > 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-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] SORT MATRIX

2008-03-10 Thread ermimi

I have a matrix with 2 columns and n row. I need sort the matrix by the first
column but the second row must be sort in the same order that the first
column. Somebody know how I can sort this matrix.
Thanks very much
-- 
View this message in context: 
http://www.nabble.com/SORT-MATRIX-tp15955823p15955823.html
Sent from the R help mailing list archive at Nabble.com.

__
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] Multiple density plots

2008-03-10 Thread Sean MacEachern
Hi all,

I'm interested in doing a multiple density plot on a number of columns in a
dataframe. 

>DF

 lineA.1  lineA.2   lineB.1  lineB.2
r1  5.355354 6.665575 10.288498 11.74750
r2  3.643415 5.427600 11.407112 13.97065
r3  5.813674 6.438502  9.628871 11.57456
r4  5.241340 5.125049 10.456221 12.35381
r5  4.640885 8.635518  8.344704 11.98484
r6  4.559852 6.416171 10.419599 10.89247
r7  4.058033 7.378469  9.043280 11.88214
r8  3.439271 5.108395 10.197870 10.65987
r9  5.129664 4.326907  8.851552 11.46618
r10 4.258742 7.002541  8.716967 13.07019



I have been reading about the simple.densityplot

However, I can't find it in R has it been replaced?



>simple.densityplot(line6.1,line6.2,line7.1,line7.2, data = DF)
Error: could not find function "simple.densityplot"

> sessionInfo()
R version 2.6.0 (2007-10-03)
i386-apple-darwin8.10.1

locale:
en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats graphics  grDevices utils datasets  methods   base

other attached packages:
[1] MASS_7.2-41

loaded via a namespace (and not attached):
[1] tools_2.6.0



Sorry if this is a simple question, but I haven't found much reference to
any changes on the web or in any tutorials.

Cheers,

Sean

__
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] SORT MATRIX

2008-03-10 Thread Erik Iverson
Here's an example.  See ?order


mt <- matrix(sample(1:20), ncol = 2)
mt[order(mt[,1]),]

Best,
Erik Iverson

ermimi wrote:
> I have a matrix with 2 columns and n row. I need sort the matrix by the first
> column but the second row must be sort in the same order that the first
> column. Somebody know how I can sort this matrix.
> Thanks very much

__
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] Multiple density plots

2008-03-10 Thread Erik Iverson
Where were you "reading about" that function?

simple.densityplot seems to be from a user-supplied package called "UsingR".

Try

install.packages("UsingR")
library("UsingR")

and then try your simple.densityplot function call.

Best,
Erik Iverson

Sean MacEachern wrote:
> Hi all,
> 
> I'm interested in doing a multiple density plot on a number of columns in a
> dataframe. 
> 
>> DF
> 
>  lineA.1  lineA.2   lineB.1  lineB.2
> r1  5.355354 6.665575 10.288498 11.74750
> r2  3.643415 5.427600 11.407112 13.97065
> r3  5.813674 6.438502  9.628871 11.57456
> r4  5.241340 5.125049 10.456221 12.35381
> r5  4.640885 8.635518  8.344704 11.98484
> r6  4.559852 6.416171 10.419599 10.89247
> r7  4.058033 7.378469  9.043280 11.88214
> r8  3.439271 5.108395 10.197870 10.65987
> r9  5.129664 4.326907  8.851552 11.46618
> r10 4.258742 7.002541  8.716967 13.07019
> 
> 
> 
> I have been reading about the simple.densityplot
> 
> However, I can't find it in R has it been replaced?
> 
> 
> 
>> simple.densityplot(line6.1,line6.2,line7.1,line7.2, data = DF)
> Error: could not find function "simple.densityplot"
> 
>> sessionInfo()
> R version 2.6.0 (2007-10-03)
> i386-apple-darwin8.10.1
> 
> locale:
> en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
> 
> attached base packages:
> [1] stats graphics  grDevices utils datasets  methods   base
> 
> other attached packages:
> [1] MASS_7.2-41
> 
> loaded via a namespace (and not attached):
> [1] tools_2.6.0
> 
> 
> 
> Sorry if this is a simple question, but I haven't found much reference to
> any changes on the web or in any tutorials.
> 
> Cheers,
> 
> Sean
> 
> __
> 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-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] Multiple density plots

2008-03-10 Thread hadley wickham
On Mon, Mar 10, 2008 at 3:55 PM, Sean MacEachern <[EMAIL PROTECTED]> wrote:
> Hi all,
>
>  I'm interested in doing a multiple density plot on a number of columns in a
>  dataframe.
>
>  >DF
>
>  lineA.1  lineA.2   lineB.1  lineB.2
>  r1  5.355354 6.665575 10.288498 11.74750
>  r2  3.643415 5.427600 11.407112 13.97065
>  r3  5.813674 6.438502  9.628871 11.57456
>  r4  5.241340 5.125049 10.456221 12.35381
>  r5  4.640885 8.635518  8.344704 11.98484
>  r6  4.559852 6.416171 10.419599 10.89247
>  r7  4.058033 7.378469  9.043280 11.88214
>  r8  3.439271 5.108395 10.197870 10.65987
>  r9  5.129664 4.326907  8.851552 11.46618
>  r10 4.258742 7.002541  8.716967 13.07019
>
>
>
>  I have been reading about the simple.densityplot
>
>  However, I can't find it in R has it been replaced?
>
>
>
>  >simple.densityplot(line6.1,line6.2,line7.1,line7.2, data = DF)
>  Error: could not find function "simple.densityplot"

You could also try:

install.packages("ggplot2")
library(ggplot2)

qplot(value, data = melt(DF), colour=variable, geom="density")

which will give you a nice legend as well.

-- 
http://had.co.nz/

__
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] SORT MATRIX

2008-03-10 Thread Gabor Csardi
M[ order(M[,1]), ]

G.

On Mon, Mar 10, 2008 at 01:56:45PM -0700, ermimi wrote:
> 
> I have a matrix with 2 columns and n row. I need sort the matrix by the first
> column but the second row must be sort in the same order that the first
> column. Somebody know how I can sort this matrix.
> Thanks very much
> -- 
> View this message in context: 
> http://www.nabble.com/SORT-MATRIX-tp15955823p15955823.html
> Sent from the R help mailing list archive at Nabble.com.
> 
> __
> 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.

-- 
Csardi Gabor <[EMAIL PROTECTED]>UNIL DGM

__
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.


  1   2   >