[R] to extract data

2009-04-20 Thread Roslina Zakaria

Hi R-users,

I have a set of data from 1958-2009, how do I extract the data from 1927 and 
2007?
 
beechworth.dt
 Year Month  Rain
1    1858 3  21.8
2    1858 4  47.0
3    1858 5  70.1
4    1858 6  78.7
5    1858 7 101.6
6    1858 8 129.8
7    1858 9  80.8
8    1858    10  41.9
 ...
 
 2009    ..
 
 
I tried:
 
 beechworth.dt.2 <- beechworth.dt[beechworth.dt$Year=="1927":"2007",]
 
and got
 
Warning message:
In beechworth.dt$Year == "1927":"2007" :
  longer object length is not a multiple of shorter object length
 
Thank you so much for any help given.




__
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] to extract data

2009-04-20 Thread Uwe Ligges



Roslina Zakaria wrote:

Hi R-users,

I have a set of data from 1958-2009, how do I extract the data from 1927 and 
2007?
 
beechworth.dt

 Year Month  Rain
11858 3  21.8
21858 4  47.0
31858 5  70.1
41858 6  78.7
51858 7 101.6
61858 8 129.8
71858 9  80.8
8185810  41.9
 ...
 
 2009..
 
 
I tried:
 
 beechworth.dt.2 <- beechworth.dt[beechworth.dt$Year=="1927":"2007",]


You probably want to index with
 beechworth.dt$Year %in% 1927:2007
or
 beechworth.dt$Year %in% c(1927, 2007)

(not sure which one given your question "from 1927 and 2007").

Uwe Ligges




 
and got
 
Warning message:

In beechworth.dt$Year == "1927":"2007" :
  longer object length is not a multiple of shorter object length
 
Thank you so much for any help given.





__
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] to extract data

2009-04-20 Thread ronggui
If Year is numeric data, then you can use:
beechworth.dt.2 <- subset(beechworth.dt, Year>=1997 & Year <=2008)
If it is character, then you can use:
beechworth.dt.2 <- subset(beechworth.dt, Year %in% as.character(1997:2008))

2009/4/20 Roslina Zakaria :
>
> Hi R-users,
>
> I have a set of data from 1958-2009, how do I extract the data from 1927 and 
> 2007?
>
> beechworth.dt
>  Year Month  Rain
> 1    1858 3  21.8
> 2    1858 4  47.0
> 3    1858 5  70.1
> 4    1858 6  78.7
> 5    1858 7 101.6
> 6    1858 8 129.8
> 7    1858 9  80.8
> 8    1858    10  41.9
>  ...
>
>  2009    ..
>
>
> I tried:
>
>  beechworth.dt.2 <- beechworth.dt[beechworth.dt$Year=="1927":"2007",]
>
> and got
>
> Warning message:
> In beechworth.dt$Year == "1927":"2007" :
>   longer object length is not a multiple of shorter object length
>
> Thank you so much for any help given.
>
>
>
>
> __
> 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.
>



-- 
HUANG Ronggui, Wincent
PhD Candidate
Dept of Public and Social Administration
City University of Hong Kong
Home page: http://asrr.r-forge.r-project.org/rghuang.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] to extract data

2009-04-20 Thread djhurio
Hi,

Try this one:

beechworth.dt.2 <- beechworth.dt[beechworth.dt$Year>="1927" &
beechworth.dt$Year<="2007",]


Martins



On Apr 20, 9:59 am, Roslina Zakaria  wrote:
> Hi R-users,
>
> I have a set of data from 1958-2009, how do I extract the data from 1927 and 
> 2007?
>  
> beechworth.dt
>  Year Month  Rain
> 1    1858 3  21.8
> 2    1858 4  47.0
> 3    1858 5  70.1
> 4    1858 6  78.7
> 5    1858 7 101.6
> 6    1858 8 129.8
> 7    1858 9  80.8
> 8    1858    10  41.9
>  ...
>  
>  2009    ..
>  
>  
> I tried:
>  
>  beechworth.dt.2 <- beechworth.dt[beechworth.dt$Year=="1927":"2007",]
>  
> and got
>  
> Warning message:
> In beechworth.dt$Year == "1927":"2007" :
>   longer object length is not a multiple of shorter object length
>  
> Thank you so much for any help given.
>
> __
> r-h...@r-project.org mailing listhttps://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guidehttp://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] to extract data

2009-04-20 Thread Christian Ritz
Hi,

maybe the following line works for you:


beechworth.dt.2 <- beechworth.dt[as.numeric(beechworth.dt$Year) %in% 1927:2007, 
]


(using as.numeric() to make sure that "Year" is numeric, maybe not needed?).

Christian

__
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 run to multinomial PLS regression in R?

2009-04-20 Thread 풍이

__
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] to extract data

2009-04-20 Thread Stefan Grosse
On Sun, 19 Apr 2009 23:59:43 -0700 (PDT) Roslina Zakaria
 wrote:

RZ> I have a set of data from 1958-2009, how do I extract the data from
RZ> 1927 and 2007? 
RZ> beechworth.dt
RZ>  Year Month  Rain

how about:

beech.cut<-subset(beechworth.dt,(Year>1926&Year<2008))

hth
Stefan

__
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] savePlot error when type = "eps" or "wmf"

2009-04-20 Thread Paul Murrell
Hi


jimdare wrote:
> Hello,
> 
> When I use savePlot(filename="xy",type="eps") or
> savePlot(filename="xy",type="wmf")  , I get the following error:
> 
> Error in grid.Call("L_textBounds", as.graphicsAnnot(x$label), x$x, x$y,  : 
>   Polygon edge not found (zero-width or zero-height?)
> 
> This doesn't occur when I change the type to "jpeg" or "bmp".  Can anyone
> explain what is going on and how I can fix it?  Your help is much
> appreciated,


The error message says it all:  a calculation is being performed to find
the edge of a polygon (from a grobX() or grobY() call?), but the polygon
has zero width or zero height so the calculation is floundering.  We
need to see the code that did the drawing to tell you more.

Paul
-- 
Dr Paul Murrell
Department of Statistics
The University of Auckland
Private Bag 92019
Auckland
New Zealand
64 9 3737599 x85392
p...@stat.auckland.ac.nz
http://www.stat.auckland.ac.nz/~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] (senza oggetto)

2009-04-20 Thread ONKELINX, Thierry
Giuseppe,

Please enter a meaningfull subject line.

Have you tried the examples from the variogram helpfile? They clearly
demonstrate how to do it. If you still have problems, then you need to
give us a reproducible example of your dataset and code.

HTH,

Thierry




ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature
and Forest
Cel biometrie, methodologie en kwaliteitszorg / Section biometrics,
methodology and quality assurance
Gaverstraat 4
9500 Geraardsbergen
Belgium 
tel. + 32 54/436 185
thierry.onkel...@inbo.be 
www.inbo.be 

To call in the statistician after the experiment is done may be no more
than asking him to perform a post-mortem examination: he may be able to
say what the experiment died of.
~ Sir Ronald Aylmer Fisher

The plural of anecdote is not data.
~ Roger Brinner

The combination of some data and an aching desire for an answer does not
ensure that a reasonable answer can be extracted from a given body of
data.
~ John Tukey

-Oorspronkelijk bericht-
Van: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org]
Namens giuseppef...@libero.it
Verzonden: zondag 19 april 2009 17:45
Aan: r-help@r-project.org
Onderwerp: [R] (senza oggetto)

Dear all, excuse me for my simple questions: i had imported with read
table a 
database with x, y,value and i must do variogram with gstat.
can someone tell me how to do it? I read the help but I could not
to obtain variogram,

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

Dit bericht en eventuele bijlagen geven enkel de visie van de schrijver weer 
en binden het INBO onder geen enkel beding, zolang dit bericht niet bevestigd is
door een geldig ondertekend document. The views expressed in  this message 
and any annex are purely those of the writer and may not be regarded as stating 
an official position of INBO, as long as the message is not confirmed by a duly 
signed 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] Buglet in plotCI

2009-04-20 Thread Jim Lemon

Dieter Menne wrote:

Hi, Jim,

there is a typo at the bottom of plotCI: there is an y.to.in which should be
x.to.in.

See list for an example.

http://article.gmane.org/gmane.comp.lang.r.general/147103

Should be:
nz <- (abs(ui - pmin(x + gap, ui)) * x.to.in) > 0.001

Dieter

  

Hi Dieter,
Thanks for the fix. I have changed the source code and it will be in the 
next version. For the benefit of those who can't wait:


1) make a copy of the source code like this:

sink("newplotCI.R")
cat("plotCI<-")
plotCI
sink()

2) Open "newplotCI.R" in Your Favorite Editor.

3) Edit line 75 as above.

4) Save "newplotCI.R"

5) Overwrite the plotCI function in plotrix (temporarily):

library(plotrix)
source("newplotDI.R")

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] Odp: (senza oggetto)

2009-04-20 Thread Petr PIKAL
Hi
I found that variogram is a function in spatial library. I tried

> ??variogram
> library(spatial)
> ?variogram

I used an example and I did not have any problem with it.
> data(topo, package="MASS")
> topo.kr <- surf.ls(2, topo)
> variogram(topo.kr, 25)
>

I do not have gstat available but from documentation seems that there 
shall not be any problem and that there is even example how to use it.

> PLEASE do read the posting guide 
http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

Regards
Petr

r-help-boun...@r-project.org napsal dne 19.04.2009 17:44:39:

> Dear all, excuse me for my simple questions: i had imported with read 
table a 
> database with x, y,value and i must do variogram with gstat.
> can someone tell me how to do it? I read the help but I could not
> to obtain variogram,
> 
> __
> 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] problem with new version

2009-04-20 Thread Jim Lemon

Roslina Zakaria wrote:

Hi R-users,

I just change to the new version of R.  I just wonder why everytime I run my 
function I will get this message:

  

source(.trPaths[4], echo=TRUE, max.deparse.length=1)



Thank you.
  

Hi Roslina,
If your function consists of the line:

source(.trPaths[4], echo=TRUE, max.deparse.length=1)

in a file that is itself sourced, R will not only source the file that 
is named by .trPaths[4], but it will echo that line as well. On the 
other hand, if the message is "Thank you.", I can only quote Paul Krassner:


"God never says, 'You're welcome'".

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.


Re: [R] data$ID -> I always get a NULL

2009-04-20 Thread Grześ

This is my result:

> class(data)
[1] "data.frame"

> str(data)
'data.frame':   2193 obs. of  83 variables:
 $ X.ID.   : Factor w/ 2193 levels "'18201'",..:
1 2 3 4 5 6 7 8 9 10 ...
 $ X.kod.   : Factor w/ 20 levels "'01'","'02'",..: 1 1
1 1 1 1 1 1 1 1 ...
 $ X.wiel. : int  7 7 7 7 7 7 7 8 8 8 ...
 $ X.piech. : num  1 99.9 4 0.5 4 2 99.9 2 2 99.9 ...
 $ X.rodz.   : int  NA 2 4 NA 4 2 2 3 2 NA ...



David Winsemius wrote:
> 
> 
> On Apr 19, 2009, at 6:45 PM, Grześ wrote:
> 
>>
>> I have database write as .csv file.
> 
> The external sorage format is not likely to be relevant. What might be  
> informative would be to produce the code that reads this file.
>>
>> When I want to get sth from my database I get NULL, but I know that  
>> there is
>> sth!
>> For example:
>>
>>> data$ID
>> NULL
>>> data$kod
>> NULL
>>
>> but command like below is always recognize by R
>>> data[2,3]
>> [1] '082'
> 
> Tell is what happens when you enter:
> 
> str(data)
> class(data)
> 
> Perhaps the third column is not named "ID" or "kod" or the object is  
> not a data.frame, but is rather a matrix.
> 
> -- 
> David Winsemius
>>
>>
>> In my opinion this problem is also connect with my attempt to create  
>> a tree.
>> I always get errors.
>>
>>> t.tree0=rpart(ID~.,t.train)
>> Error in eval(expr, envir, enclos) : object "ID" not found
>>
>>> t.tree0=rpart(kod~.,t.train)
>> Error in eval(expr, envir, enclos) : object "kod" not found
>>
>> What I should do to create my simple trees?
>> -- 
>> View this message in context:
>> http://www.nabble.com/data%24ID--%3E-I-always-get-a-NULL-tp23128214p23128214.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.
> 
> David Winsemius, MD
> Heritage Laboratories
> West Hartford, CT
> 
> __
> 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.
> 
> 

-- 
View this message in context: 
http://www.nabble.com/data%24ID--%3E-I-always-get-a-NULL-tp23128214p23132506.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] problem with new version

2009-04-20 Thread Roslina Zakaria

Hi R-users,

I just change to the new version of R.  I just wonder why everytime I run my 
function I will get this message:

> source(.trPaths[4], echo=TRUE, max.deparse.length=1)

Thank you.


 
__
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] Sweave: Changing the background color, adding a border

2009-04-20 Thread Dieter Menne
Christophe Genolini  u-paris10.fr> writes:

...
> Thanks for your answer. I finally succeed.
> I used the listings package to define an environment that put code in a 
> grey box. The command is \lstnewenvironment{Sinput}[1][]{
> 
...

This is too nice code to be lost, but it suffers from some line-break-problems 
and it would be good if it were a self-running Sweave example. 

May I suggest that you put it in some format-conserving place, e.g. in the
Wiki, and post the link here?

Dieter

__
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] [R-pkgs] xterm256

2009-04-20 Thread Romain Francois

This is the first release of the xterm256 package.

xterm256 is a small package that takes advantage of the 256 color mode 
of xterm, enabling use of foreground and background colors in the R 
console. The package exposes one function "style" that takes three 
arguments:

- (x) the text to style
- (bg) the background color to use
- (fg) the foreground color to use

The color might be specified as an number between 0 and 255 (see 
http://frexx.de/xterm-256-notes/), as classic hex notation ( "#ff" ) 
or as an R color ("red"). Note that the color specified is mapped to the 
closest color of the 256 colors using an euclidean distance in the RGB 
space.


The package is maintained at r-forge as part of the highlight project: 
http://r-forge.r-project.org/projects/highlight/ and welcomes requests 
(feature requests, bug requests, ...) though its tracker : 
http://r-forge.r-project.org/tracker/?group_id=384


See also this post on my blog: 
http://romainfrancois.blog.free.fr/index.php?post/2009/04/18/Colorful-terminal%3A-the-R-package-%22xterm256%22 



Romain

--
Romain Francois
Independent R Consultant
+33(0) 6 28 91 30 30
http://romainfrancois.blog.free.fr

___
R-packages mailing list
r-packa...@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-packages

__
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 graph into MS Word: which format to use?

2009-04-20 Thread Uwe Ligges



jjh21 wrote:

Hello,

The journal I am publishing in requires MS Word files. What is my best
option for getting a high quality image of a graph done in R into Word?
JPEG? Postscript?


Windows metafile, if you are under Windows anyway.

Uwe Ligges




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] R graph into MS Word: which format to use?

2009-04-20 Thread jjh21

Hello,

The journal I am publishing in requires MS Word files. What is my best
option for getting a high quality image of a graph done in R into Word?
JPEG? Postscript?

Thanks.
-- 
View this message in context: 
http://www.nabble.com/R-graph-into-MS-Word%3A-which-format-to-use--tp23133745p23133745.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] Re : PCA and automatic determination of the number of components

2009-04-20 Thread justin bem
See ade4 or mva package.
 Justin BEM
BP 1917 Yaoundé



De : nikolay12 
À : r-help@r-project.org
Envoyé le : Lundi, 20 Avril 2009, 4h37mn 41s
Objet : [R] PCA and automatic determination of the number of components


Hi all, 

I have relatively small dataset on which I would like to perform a PCA. I am
interested about a package that would also combine a method for determining
the number of components (I know there are plenty of approaches to this
problem). Any suggestions about a package/function?

thanks,

Nick
-- 
View this message in context: 
http://www.nabble.com/PCA-and-automatic-determination-of-the-number-of-components-tp23129941p23129941.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.



  
[[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] R graph into MS Word: which format to use?

2009-04-20 Thread Simon Pickett
I actually get superior results from creating a pdf, opening it in adobe 
acrobat, adjust the image size so it is big as possible with the screen, 
then copying it into word (by using the little square capture icon).


HTH, Simon.


- Original Message - 
From: "jjh21" 

To: 
Sent: Monday, April 20, 2009 11:01 AM
Subject: [R] R graph into MS Word: which format to use?




Hello,

The journal I am publishing in requires MS Word files. What is my best
option for getting a high quality image of a graph done in R into Word?
JPEG? Postscript?

Thanks.
--
View this message in context: 
http://www.nabble.com/R-graph-into-MS-Word%3A-which-format-to-use--tp23133745p23133745.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] PCA and automatic determination of the number of components

2009-04-20 Thread Bruno Falissard
You can also use parallel analysis using the scree.plot function of the
"psy" package.
Regards,
Bruno 



Bruno Falissard
INSERM U669, PSIGIAM
"Paris Sud Innovation Group in Adolescent Mental Health"
Maison de Solenn
97 Boulevard de Port Royal
75679 Paris cedex 14, France
tel : (+33) 6 81 82 70 76
fax : (+33) 1 58 41 28 43
web site : http://perso.wanadoo.fr/bruno.falissard/



-Message d'origine-
De : r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] De
la part de nikolay12
Envoyé : lundi 20 avril 2009 05:38
À : r-help@r-project.org
Objet : [R] PCA and automatic determination of the number of components



Hi all, 

I have relatively small dataset on which I would like to perform a PCA. I am
interested about a package that would also combine a method for determining
the number of components (I know there are plenty of approaches to this
problem). Any suggestions about a package/function?

thanks,

Nick
-- 
View this message in context:
http://www.nabble.com/PCA-and-automatic-determination-of-the-number-of-compo
nents-tp23129941p23129941.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] R graph into MS Word: which format to use?

2009-04-20 Thread Stefan Grosse
On Mon, 20 Apr 2009 03:01:42 -0700 (PDT) jjh21 
wrote:

J> The journal I am publishing in requires MS Word files. What is my
J> best option for getting a high quality image of a graph done in R
J> into Word? JPEG? Postscript?

I use png or eps. The latter has the better output but in old
Word versions you don't get WYSIWIG - only pdf conversion or printing
with a postscript printer reveals the true figure. But maybe I just
have missed an option.

hth
Stefan

__
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 graph into MS Word: which format to use?

2009-04-20 Thread Gabor Grothendieck
Use wmf format.  That's a vector format rather than bitmapped
so it will give better quality.  Also you will be able to edit the
image right in Word, e.g. change axis labels.

On Mon, Apr 20, 2009 at 6:01 AM, jjh21  wrote:
>
> Hello,
>
> The journal I am publishing in requires MS Word files. What is my best
> option for getting a high quality image of a graph done in R into Word?
> JPEG? Postscript?
>
> Thanks.
> --
> View this message in context: 
> http://www.nabble.com/R-graph-into-MS-Word%3A-which-format-to-use--tp23133745p23133745.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] R-Squared with biglm?

2009-04-20 Thread Bryan Lim
I've been working with a rather large data set (~10M rows), and while biglm 
works beautifully for generating coefficients, it does not report an r-squared. 
It does report RSS. Any idea on how one could coax an R-squared out of biglm? 

Thanks in advance for any help with this!

Bryan Lim
Lecturer
Department of Finance
University of Melbourne


  
[[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] Two or more dimensional root (Zero) finding

2009-04-20 Thread enrico.fosco...@libero.it
Good morning to all,

I should find the zero of a specific function with 
respect to a vector of arguments.
Does it exist something similar in R?

Thank 
you very much,

Enrico Foscolo

__
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 graph into MS Word: which format to use?

2009-04-20 Thread Duncan Mackay
Word can be memory hungry when using graphics.
Another alternative is the metafile which is very compact and can give good 
results
eg from the example

win.metafile("Rplot%02d.wmf", pointsize = 10)

Regards

Duncan Mackay
Department of Agronomy & Soil Science
University of New England
ARMIDALE NSW 2351
Email home: mac...@northnet.com.au

At 20:01 20/04/2009, you wrote:

>Hello,
>
>The journal I am publishing in requires MS Word files. What is my best
>option for getting a high quality image of a graph done in R into Word?
>JPEG? Postscript?
>
>Thanks.
>--
>View this message in context: 
>http://www.nabble.com/R-graph-into-MS-Word%3A-which-format-to-use--tp23133745p23133745.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.

[[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] data$ID -> I always get a NULL

2009-04-20 Thread David Winsemius


On Apr 20, 2009, at 4:33 AM, Grześ wrote:



This is my result:


class(data)

[1] "data.frame"


str(data)

'data.frame':   2193 obs. of  83 variables:
$ X.ID.   : Factor w/ 2193 levels  
"'18201'",..:

1 2 3 4 5 6 7 8 9 10 ...
$ X.kod.   : Factor w/ 20 levels  
"'01'","'02'",..: 1 1

1 1 1 1 1 1 1 1 ...
$ X.wiel. : int  7 7 7 7 7 7 7 8 8 8 ...
$ X.piech. : num  1 99.9 4 0.5 4 2 99.9 2 2  
99.9 ...

$ X.rodz.   : int  NA 2 4 NA 4 2 2 3 2 NA ...

David Winsemius wrote:



On Apr 19, 2009, at 6:45 PM, Grześ wrote:



I have database write as .csv file.


The external sorage format is not likely to be relevant. What might  
be

informative would be to produce the code that reads this file.


When I want to get sth from my database I get NULL, but I know that
there is
sth!
For example:


data$ID

NULL

data$kod

NULL


So the names of your columns are not "ID" and "kod" but rather "X.ID."  
and "X.kod."


Try instead:
 data$X.ID.
#and:
 data$X.kkod. # you will need to use both the periods if your  
column names end in periods.





but command like below is always recognize by R

data[2,3]

[1] '082'



That must have been a different version of data, since data[2,3] from  
the dataframe above should have been   the number 7  number rather  
than a string. I would also suggest that you start naming your  
data.frames something other than "data", since that is a reserved word  
used by quite a few functions.







Tell is what happens when you enter:

str(data)
class(data)

Perhaps the third column is not named "ID" or "kod" or the object is
not a data.frame, but is rather a matrix.

--
David Winsemius



In my opinion this problem is also connect with my attempt to create
a tree.
I always get errors.


t.tree0=rpart(ID~.,t.train)

Error in eval(expr, envir, enclos) : object "ID" not found


t.tree0=rpart(kod~.,t.train)

Error in eval(expr, envir, enclos) : object "kod" not found

What I should do to create my simple trees?




--


David Winsemius, MD
Heritage Laboratories
West Hartford, CT

__
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] Buglet in plotCI

2009-04-20 Thread Derek Ogle
Jim and Dieter,

Thank you for the quick reply and precise fix.  My plot now works as
expected.  Thanks again.


> -Original Message-
> From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-
> project.org] On Behalf Of Jim Lemon
> Sent: Monday, April 20, 2009 4:21 AM
> To: dieter.me...@menne-biomed.de; r-help@r-project.org
> Subject: Re: [R] Buglet in plotCI
> 
> Dieter Menne wrote:
> > Hi, Jim,
> >
> > there is a typo at the bottom of plotCI: there is an y.to.in which
> should be
> > x.to.in.
> >
> > See list for an example.
> >
> > http://article.gmane.org/gmane.comp.lang.r.general/147103
> >
> > Should be:
> > nz <- (abs(ui - pmin(x + gap, ui)) * x.to.in) > 0.001
> >
> > Dieter
> >
> >
> Hi Dieter,
> Thanks for the fix. I have changed the source code and it will be in
> the
> next version. For the benefit of those who can't wait:
> 
> 1) make a copy of the source code like this:
> 
> sink("newplotCI.R")
> cat("plotCI<-")
> plotCI
> sink()
> 
> 2) Open "newplotCI.R" in Your Favorite Editor.
> 
> 3) Edit line 75 as above.
> 
> 4) Save "newplotCI.R"
> 
> 5) Overwrite the plotCI function in plotrix (temporarily):
> 
> library(plotrix)
> source("newplotDI.R")
> 
> 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-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 : PCA and automatic determination of the number of components

2009-04-20 Thread Jari Oksanen
justin bem  yahoo.fr> writes:

> 
> See ade4 or mva package.
>  Justin BEM
> BP 1917 Yaoundé
> 
I guess the problem was not to find PCA (which is easy to find), but
 finding an automatic method of selecting ("determining" sounds like 
that selection would be correct in some objective sense) numbers of 
components to be retained. I thin neither ade4 nor mva give much support 
here (in particular the latter which does not exist any more).

The usual place to look at is multivariate task view: 

http://cran.r-project.org/web/views/Multivariate.html

Under the heading "Projection methods" and there under 
"Principal components" the taskview mentions packages 
nFactors and paran that help in selecting the number 
of components to retain. 

Are these Task Views really so invisible in R that people don't find
them? Usually they are the first place to look at when you need 
something you don't have. In statistics, I mean. If they are invisible, 
could they be made more visible?

Cheers, Jari Oksanen

> 
> De : nikolay12  gmail.com>
> À : r-help  r-project.org
> Envoyé le : Lundi, 20 Avril 2009, 4h37mn 41s
> Objet : [R] PCA and automatic determination of the number of components
> 
> Hi all, 
> 
> I have relatively small dataset on which I would like to perform a PCA. I am
> interested about a package that would also combine a method for determining
> the number of components (I know there are plenty of approaches to this
> problem). Any suggestions about a package/function?
> 
> thanks,
> 
> Nick

__
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 graph into MS Word: which format to use?

2009-04-20 Thread Frank E Harrell Jr

jjh21 wrote:

Hello,

The journal I am publishing in requires MS Word files. What is my best
option for getting a high quality image of a graph done in R into Word?
JPEG? Postscript?

Thanks.


Double check the instructions for authors.  Most journals take pdf and 
eps as separate files.


Frank

--
Frank E Harrell Jr   Professor and Chair   School of Medicine
 Department of Biostatistics   Vanderbilt University

__
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] help with this code

2009-04-20 Thread Tal Galili
Did you try using:debug(f2)
and then running the function, and see what is your variables condition
before the error ?


On Sun, Apr 19, 2009 at 12:58 PM, li li  wrote:

> Hi, can anyone help me with the following code?  Thanks!
>
> library(mvtnorm)
> f2 <- function(n, rho) {
> var <- matrix(c(1,rho,rho,1), nrow=2, ncol=2, byrow=T)
> beta <-  seq(0, 1, length.out=n+1)
> alpha <- sort (sapply(1-beta, qnorm))
> x <- array(0, dim=c(n, n))
> for (s in 1:n) {
> for (t in 1:n){
>if (s>=t)
>   x[s,t] <- pmvnorm(lower=c(alpha[s], alpha[t]),upper=c(alpha[s+1],
> alpha[t+1]),  mean=c(0,0), corr=var)/(s*(s+1))
>else
>   x[s,t] <- pmvnorm(lower=c(alpha[s], alpha[t]),upper=c(alpha[s+1],
> alpha[t+1]), mean-c(0,0), corr=var)/(t*(t+1))
> } }
>
> n*beta[2]-(n-1)*pmvnorm(lower=c(alpha[n-1],alpha[n-1]), upper=rep(Inf,2),
> corr=var, mean=c(0,0))+n*(n-1)*sum(x) }
>
> I got the error informatio as below if I want to calculate the value the
> function for some specific parameters.
>
> > f2(5, 0.1)
> Error in checkmvArgs(lower = lower, upper = upper, mean = mean, corr =
> corr,  :
>  ‘diag(corr)’ and ‘lower’ are of different length
>
>[[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.
>
>


-- 
--


My contact information:
Tal Galili
Phone number: 972-50-3373767
FaceBook: Tal Galili
My Blogs:
http://www.r-statistics.com/
http://www.talgalili.com
http://www.biostatistics.co.il

[[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] Two or more dimensional root (Zero) finding

2009-04-20 Thread Ben Bolker



enrico.fosco...@libero.it wrote:
> 
> Good morning to all,
> 
> I should find the zero of a specific function with 
> respect to a vector of arguments.
> Does it exist something similar in R?
> 

Someone else may pipe up with a better answer, but this is generally
a difficult problem (see _Numerical Recipes_ for discussion).  A
reasonable approach is to search for the minimum of the square
of the function (using optim(), nlmin(), etc.).

  Ben Bolker
-- 
View this message in context: 
http://www.nabble.com/Two-or-more-dimensional-root-%28Zero%29-finding-tp23135160p23136292.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] system is exactly singular

2009-04-20 Thread onyourmark

Hi. I have a csv file. I imported it with
 mydata<-read.table("C:/dataForR/radiology/WordFrequency.csv", header=TRUE,
sep=",")
> dim(mydata)
[1] 982 925

The first column had the doc numbers like doc1, doc2, etc.  so I did 
mydataNum<-mydata[,-1]
> dim(mydataNum)
[1] 982 924

The second to last column was also not numeric and so I did
> mydataNum<-mydataNum[,-923]
> dim(mydataNum)
[1] 982 923

when I checked
> str(mydataNum)
I got
'data.frame':   982 obs. of  923 variables:

and then a list of all the variables and it said they were int and num.

I tried
> fit <- factanal(mydataNum, 3, rotation="varimax")
Error in solve.default(cv) : 
  Lapack routine dgesv: system is exactly singular

Any idea why this is happening?
Thanks.

-- 
View this message in context: 
http://www.nabble.com/system-is-exactly-singular-tp23136395p23136395.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] Paired test for 2-way ANOVA

2009-04-20 Thread A Ezhil

Hi,

I have an experimental data with 2 factors: visit and treatment. Each subject 
has 2 visits and on each visit they get a treatment. We take samples before and 
after treatment. I can easily to do the 2-way ANOVA in R with visit and 
treatment as factors. 

anova( lm(data ~ visit*treatment) )

If I want to do the same 2-way ANOVA for the paired samples, how can I do that? 
Is there any R packages for that?

Thanks in advance.

Kind regards,
Ezhil

__
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] bug when subtracting decimals?

2009-04-20 Thread wolfgang.siewert

Try this:

0.7-0.3==0.4
(We get FALSE)
0.7-0.3<0.4
(We get TRUE)

but
0.8-0.3==0.5
(TRUE)
0.8-0.3<0.5
(FALSE)

Funny, he?

There is a way around: 
round(0.7-0.3,1)==0.4
(TRUE)

Obviously there is a problem with some combinations of decimal subtractions,
that - we have the feeling - shouldt be solved.

Best regards
Sven & Wolfgang
-- 
View this message in context: 
http://www.nabble.com/bug-when-subtracting-decimals--tp23136337p23136337.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] problem with new version

2009-04-20 Thread Ben Bolker



Roslina Zakaria wrote:
> 
> 
> Hi R-users,
> 
> I just change to the new version of R.  I just wonder why everytime I run
> my function I will get this message:
> 
>> source(.trPaths[4], echo=TRUE, max.deparse.length=1)
> 
> 

 Are you by any chance using Tinn-R?  Could be a glitch in the interaction
between Tinn-R and R 2.9.0 ?
-- 
View this message in context: 
http://www.nabble.com/problem-with-new-version-tp23133214p23136237.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] doing zero inflated glmm for count data with fmr

2009-04-20 Thread levyofi

Hello R users,
Doing My PhD I collected count data which I believe is zero inflated. I have
run a statistical model with lmer and family=poisson and got
summary(model)@sigma=1 so I believe there is no overdispertion.  I would
like to use the fmr function from the 'gnlm' library but I just cannot
figure out from the examples in the help page and some forums out there how
to convert the lmer parameters to the one used in fmr...

I have these variables in the model:
  count: the number of logs in a foraging tray (this is the response
variable).
  ta: the ambient temperature at the foraging tray.
  habitat: the habitat type of the foraging tray.
  season: the season in which the experiment session took place (summer or
winter).
  moon: the moon phase (new or full).
  position: a random factor (I had 4 foraging stations)
  individual_id: a random factor indicating the individual foraged in the
tray.
  
This is the lmer parameters I have used:
model<-lmer(count~ta*habitat*season*moon + (1|individual_id) + (1|position),
data=countdata, family=poisson) 

I would really appreciate the help. I love working with R and it really
changed the way I work with my data.
Thanks again,
Ofir.

-- 
View this message in context: 
http://www.nabble.com/doing-zero-inflated-glmm-for-count-data-with-fmr-tp23136570p23136570.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] bug when subtracting decimals?

2009-04-20 Thread Henrique Dallazuanna
This is a FAQ.

Try this:

all.equal(0.7-0.3, 0.4)

On Mon, Apr 20, 2009 at 10:07 AM, wolfgang.siewert <
wolfgang.siew...@gmail.com> wrote:

>
> Try this:
>
> 0.7-0.3==0.4
> (We get FALSE)
> 0.7-0.3<0.4
> (We get TRUE)
>
> but
> 0.8-0.3==0.5
> (TRUE)
> 0.8-0.3<0.5
> (FALSE)
>
> Funny, he?
>
> There is a way around:
> round(0.7-0.3,1)==0.4
> (TRUE)
>
> Obviously there is a problem with some combinations of decimal
> subtractions,
> that - we have the feeling - shouldt be solved.
>
> Best regards
> Sven & Wolfgang
> --
> View this message in context:
> http://www.nabble.com/bug-when-subtracting-decimals--tp23136337p23136337.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.
>



-- 
Henrique Dallazuanna
Curitiba-Paraná-Brasil
25° 25' 40" S 49° 16' 22" O

[[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] bug when subtracting decimals?

2009-04-20 Thread Dimitris Rizopoulos

this is a (very) Frequently Asked Question; check:

http://cran.r-project.org/doc/FAQ/R-FAQ.html#Why-doesn_0027t-R-think-these-numbers-are-equal_003f


Best,
Dimitris


wolfgang.siewert wrote:

Try this:

0.7-0.3==0.4
(We get FALSE)
0.7-0.3<0.4
(We get TRUE)

but
0.8-0.3==0.5
(TRUE)
0.8-0.3<0.5
(FALSE)

Funny, he?

There is a way around: 
round(0.7-0.3,1)==0.4

(TRUE)

Obviously there is a problem with some combinations of decimal subtractions,
that - we have the feeling - shouldt be solved.

Best regards
Sven & Wolfgang


--
Dimitris Rizopoulos
Assistant Professor
Department of Biostatistics
Erasmus University Medical Center

Address: PO Box 2040, 3000 CA Rotterdam, the Netherlands
Tel: +31/(0)10/7043478
Fax: +31/(0)10/7043014

__
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] Two or more dimensional root (Zero) finding

2009-04-20 Thread Ravi Varadhan
Ben,

That is not a good approach, i.e. finding the zero, x*, of F(x), such that
F(x*) = 0, as a minimum of ||F(x)|| is NOT a good approach.  Any root of
F(x) is indeed a global minimum of ||F(x)||, or for that matter, the global
minimum of any f(F(x)), where f(.) is a mapping from R^p to R, such that it
has a uniques global minimizer x=0.  However, the converse does not
generally hold, i.e. a (local) minimizer of f(F(x)) is not necessarily a
root of F(x).  See Ortega and Rheinboldt (p. 97, 1970) for theorem on this.


There are better approaches that directly solve the non-linear system (e.g.
Newton's method and spectral appproaches).  There are 2 packages in R that
are quite useful for finding roots of nonlinear systems of equations:  "BB"
and "nleqslv".  For more information, You can try, for example:

library(BB)
?dfsane

Hope this helps,
Ravi.


---

Ravi Varadhan, Ph.D.

Assistant Professor, The Center on Aging and Health

Division of Geriatric Medicine and Gerontology 

Johns Hopkins University

Ph: (410) 502-2619

Fax: (410) 614-9625

Email: rvarad...@jhmi.edu

Webpage:  http://www.jhsph.edu/agingandhealth/People/Faculty/Varadhan.html

 





-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On
Behalf Of Ben Bolker
Sent: Monday, April 20, 2009 9:05 AM
To: r-help@r-project.org
Subject: Re: [R] Two or more dimensional root (Zero) finding




enrico.fosco...@libero.it wrote:
> 
> Good morning to all,
> 
> I should find the zero of a specific function with respect to a vector 
> of arguments.
> Does it exist something similar in R?
> 

Someone else may pipe up with a better answer, but this is generally a
difficult problem (see _Numerical Recipes_ for discussion).  A reasonable
approach is to search for the minimum of the square of the function (using
optim(), nlmin(), etc.).

  Ben Bolker
--
View this message in context:
http://www.nabble.com/Two-or-more-dimensional-root-%28Zero%29-finding-tp2313
5160p23136292.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] Paired test for 2-way ANOVA

2009-04-20 Thread Mike Lawrence
Paired (aka. Repeated measures, aka. within-Ss) tests can be achieved
by using aov() and specifying the within-Ss effect in the error term:

my_aov = aov( dependent_variable~between_Ss_variable*within_Ss_variable
+ Error(Ss_id/(within_Ss_variable)))

summary(my_aov)

On Mon, Apr 20, 2009 at 10:25 AM, A Ezhil  wrote:
>
> Hi,
>
> I have an experimental data with 2 factors: visit and treatment. Each subject 
> has 2 visits and on each visit they get a treatment. We take samples before 
> and after treatment. I can easily to do the 2-way ANOVA in R with visit and 
> treatment as factors.
>
> anova( lm(data ~ visit*treatment) )
>
> If I want to do the same 2-way ANOVA for the paired samples, how can I do 
> that? Is there any R packages for that?
>
> Thanks in advance.
>
> Kind regards,
> Ezhil
>
> __
> 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.
>



-- 
Mike Lawrence
Graduate Student
Department of Psychology
Dalhousie University

Looking to arrange a meeting? Check my public calendar:
http://tr.im/mikes_public_calendar

~ Certainty is folly... I think. ~

__
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 to access file backed big matrix (package bigmemory)

2009-04-20 Thread utkarshsinghal

__
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] explicit documentation

2009-04-20 Thread Duncan Murdoch

ronggui wrote:

It is always unfair to complain about volunteer work, and what you
should do is to make contributions.
  


I only half agree with this:  I think that it's fair to complain, as 
long as you make contributions.  With documentation, if you don't think 
it's clear, as part of your complaint you should rewrite it in a way 
that is clear:  then the author can understand what you found unclear 
about it.  (It may well happen that your revision isn't accepted, 
because it may be less clear than the original in the author's opinion, 
or it may be incorrect:  but at least it saves the author the time of 
trying to figure out what you'd prefer.)


Duncan Murdoch

2009/4/20 Rolf Turner :
  

On 19/04/2009, at 8:59 PM, Patrick Burns wrote:



Rolf Turner wrote:
  

On 17/04/2009, at 10:21 PM, Duncan Murdoch wrote:



Benjamin Tyner wrote:
  

Many thanks Duncan. Perhaps this merits a more explicit note in the
documentation?



The quote I gave is from the documentation.  How could it be more
explicit?
  

This is unfortunately typical of the attitude of R-core people toward the
documentation.  ``It's clear.'' they say.  ``It's explicit.''  Clear and
explicit once you *know* what it's saying.  Not before, but.


I think this unfairly blames R-core for being human.
  

   Why is this unfair?  R-core is supposed to be superhuman! :-)

   cheers,

   Rolf

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









__
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 estimate VAR(p)-model robustly?

2009-04-20 Thread Irene Schreiber
Hello,

 

Does anyone know about robust estimation of vector autoregressive models
(VAR(p)) in R? Or in Matlab?

Currently I am using the function ar().

The problem is, that the variances of my data change a lot with time, and we
also have some outliers in the data. That is why, I presume, that we would
get quite different results when estimating robustly.

 

I would be very grateful if someone could help!

Thanks a lot!

 

Irene.

 

 

 


[[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] setting levels in contourplot()

2009-04-20 Thread Cable, Samuel B Civ USAF AFMC AFRL/RVBXI
Does the contourplot() routine have an argument analogous to the
"levels" argument in the contour() routine?  More generally, is there a
way for the user to fix the contour levels in contourplot()?  Thanks.

--Sam Cable

__
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] Two or more dimensional root (Zero) finding

2009-04-20 Thread Ben Bolker
Ravi Varadhan wrote:

> That is not a good approach, i.e. finding the zero, x*, of F(x), such that
> F(x*) = 0, as a minimum of ||F(x)|| is NOT a good approach.  Any root of
> F(x) is indeed a global minimum of ||F(x)||, or for that matter, the global
> minimum of any f(F(x)), where f(.) is a mapping from R^p to R, such that it
> has a uniques global minimizer x=0.  However, the converse does not
> generally hold, i.e. a (local) minimizer of f(F(x)) is not necessarily a
> root of F(x).  See Ortega and Rheinboldt (p. 97, 1970) for theorem on this.
>
> There are better approaches that directly solve the non-linear system (e.g.
> Newton's method and spectral appproaches).  There are 2 packages in R that
> are quite useful for finding roots of nonlinear systems of equations:  "BB"
> and "nleqslv".  For more information, You can try, for example:
> 
>   library(BB)
>   ?dfsane
> 
> Hope this helps,
> Ravi.

  Thanks for the correction!  I should also clarify that I misremembered
what Numerical Recipes said -- it explains (as you did) why collapsing
does _not_ work well.

  cheers
 Ben




signature.asc
Description: OpenPGP digital signature
__
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] setting levels in contourplot()

2009-04-20 Thread David Winsemius


On Apr 20, 2009, at 10:30 AM, Cable, Samuel B Civ USAF AFMC AFRL/RVBXI  
wrote:



Does the contourplot() routine have an argument analogous to the
"levels" argument in the contour() routine?  More generally, is  
there a

way for the user to fix the contour levels in contourplot()?  Thanks.

--Sam Cable


You might consider offering the name of the package.

David Winsemius, MD
Heritage Laboratories
West Hartford, CT

__
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] doing zero inflated glmm for count data with fmr

2009-04-20 Thread Ben Bolker



levyofi wrote:
> 
> Hello R users,
> Doing My PhD I collected count data which I believe is zero inflated. I
> have run a statistical model with lmer and family=poisson and got
> summary(model)@sigma=1 so I believe there is no overdispertion.  
> 

You have been misled.  sigma is set to 1 by definition for the Poisson and
binomial families.
Try with family="quasipoisson" and see what you get.


levyofi wrote:
> 
> I would like to use the fmr function from the 'gnlm' library but I just
> cannot figure out from the examples in the help page and some forums out
> there how to convert the lmer parameters to the one used in fmr...
> 
> I have these variables in the model:
>   count: the number of logs in a foraging tray (this is the response
> variable).
>   ta: the ambient temperature at the foraging tray.
>   habitat: the habitat type of the foraging tray.
>   season: the season in which the experiment session took place (summer or
> winter).
>   moon: the moon phase (new or full).
>   position: a random factor (I had 4 foraging stations)
>   individual_id: a random factor indicating the individual foraged in the
> tray.
>   
> This is the lmer parameters I have used:
> model<-lmer(count~ta*habitat*season*moon + (1|individual_id) +
> (1|position), data=countdata, family=poisson) 
> 

I think (but am not sure) that "fmr" won't do what you want; it will fit
zero-inflated
neg binom, but not mixed-effect models.  "gnlm" in Lindsey's repeated
package does
mixed-effect models with neg binom, but not zero-inflation.  Are you sure
you need
zero-inflation after accounting for random effects?

glmm.admb in the glmmADMB package will do *most* of what you want, but ...
not crossed random effects as you have specified above (it only allows for a
single
grouping factor, as far as I can see).

If you really want all of this (zero-inflated negative binomial, crossed
random
effects) your choices would seem to be (a) the full version of AD Model
Builder
(maybe?) or (b) WinBUGS ...

  I would strongly recommend that you forward further queries on this
to the r-sig-mixed-models specialty list ...

  cheers
Ben Bolker


-- 
View this message in context: 
http://www.nabble.com/doing-zero-inflated-glmm-for-count-data-with-fmr-tp23136570p23138625.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] setting levels in contourplot()

2009-04-20 Thread Dieter Menne
Cable, Samuel B  hanscom.af.mil> writes:

> Does the contourplot() routine have an argument analogous to the
> "levels" argument in the contour() routine?  More generally, is there a
> way for the user to fix the contour levels in contourplot()?  Thanks.

Assuming lattice:

cuts

Dieter

__
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 graph into MS Word: which format to use?

2009-04-20 Thread Dieter Menne
Uwe Ligges  statistik.tu-dortmund.de> writes:

> > The journal I am publishing in requires MS Word files. What is my best
> > option for getting a high quality image of a graph done in R into Word?
> > JPEG? Postscript?
> 
> Windows metafile, if you are under Windows anyway.

But make sure that clipped data are really clipped and do not 
magically appear in the next panel. Some years ago, this 
cost me a client.

Dieter

__
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] setting levels in contourplot()

2009-04-20 Thread David Winsemius


On Apr 20, 2009, at 11:22 AM, Dieter Menne wrote:


Cable, Samuel B  hanscom.af.mil> writes:


Does the contourplot() routine have an argument analogous to the
"levels" argument in the contour() routine?  More generally, is  
there a

way for the user to fix the contour levels in contourplot()?  Thanks.


Assuming lattice:

cuts

Dieter



Also assuming lattice, cuts would be the analog of nlevels= in  
contour, but to specify particular levels which I believe was the  
request, it appears one would need to set pretty=FALSE and use the at=  
parameter in panel.contourplot.


--
David Winsemius, MD
Heritage Laboratories
West Hartford, CT

__
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] importing spreadsheet data - linera regression - panel data

2009-04-20 Thread Millo Giovanni
Dear Cecilia,

just adding some examples to Stefan's post, which says everything
already. I've recently gone mad with reshaping, so I assume it is a
little tricky. Or maybe what I tell you is obvious, then just skip it.

**import**

Your files are spreadsheets, so the best way to import is to save them
in a .csv or maybe in a .txt file (File>Save as>[choose 'Tab delimited'
format]) and then do as Stefan said with read.csv() or, if you saved in
tab delimited, read.table(..., sep="\t"). See help("read.table") or
?read.table which is the same.

Specifically, looks like you already exported them as tab delimited. So
something like 

yourdata <- read.table(file="yourfile.txt", sep="\t", header=TRUE)
should work.

**reshape**

Now 'yourdata' is a data.frame object. Then you reshape() them, as said,
from 'wide' to 'long' format.
You need to do something like

yourreshapeddata <- reshape(yourdata, direction="long",
varying=list(paste("revenue", 2007:1998, sep="")))

i.e., 'varying' must be the list of the vectors (here: only one vector!)
of column names corresponding to the time-varying variables to be
stacked. (Hint: see what 'paste("revenue", 2007:1998, sep=""))' does).

An example on the Grunfeld data just to clarify:
data(Grunfeld, package="Ecdat") # data start in 'long' format, the one
you need
## make them 'wide'
pippo<-reshape(Grunfeld, direction="wide", timevar="year", idvar="firm")

## see what you got
fix(pippo) 
## now make them 'long' again (what you need!)
pluto<-reshape(pippo, direction="long",
varying=list(paste("inv",1935:1954,sep="."),paste("value",1935:1954,sep=
"."),paste("capital",1935:1954,sep=".")))
## see how it worked. Notice the "id" and "time" variables it produced.
fix(pluto)

(Nevermind the names, Pippo and Pluto are Goofy and his dog in Italian.
Stands for "Foo" etc.)

**merge**

You say, you have one variable per spreadsheet/txt-file. Then as soon as
you have as many 'long' dataframes, let's say they are called 'revenue',
'cost', etc., you might want to merge() them two by two to make your
final dataframe, along the lines of

yourfinaldata <- merge("revenue", "cost", by=c("id", "time"))

**modeling**

Now your data are ready to do, say,

yourmodel <- lm(revenue~cost, data=yourfinaldata)

Notice that if you want to use 'plm' for panel data models, you will
want to have "id" and "time" in the first two columns, or alternatively
to specify an 'index' (see ?plm in library(plm)). Most "panel" models
can also be very effectively estimated with the 'nlme' or 'lme4'
packages, although the syntax is slightly more complicated.

Just to be sure, I am adding a small reproducible example on fake data
that should resemble what you have to do:

## begin example ##
## make fake 'wide' data for variable 'revenue'
pippo1<-matrix(rnorm(12),ncol=4)
pippo1<-as.data.frame(pippo1)
pippo1[,1]<-1:3
dimnames(pippo1)[[2]]<-c("firm",paste("revenue",2002:2000, sep=""))
## reshape
pippo1<-reshape(pippo1, direction="long", drop="firm",
varying=list(paste("revenue",2002:2000,sep="")))
## ...and have a look:
print(pippo1)

## make fake 'wide' data for variable 'cost'
pippo2<-matrix(rnorm(12),ncol=4)
pippo2<-as.data.frame(pippo2)
pippo2[,1]<-1:3
dimnames(pippo2)[[2]]<-c("firm",paste("cost",2002:2000, sep=""))
## reshape
pippo2<-reshape(pippo2, direction="long", drop="firm",
varying=list(paste("cost",2002:2000,sep="")))

## merge them (R is smart enough to guess the names of 'by' variables)
alldata<-merge(pippo1, pippo2)
## see what happened:
print(alldata)

## fix var names
dimnames(alldata)[[2]][3:4]<-c("revenue","cost")

## estimate a linear model
yourmod<-lm(cost~revenue, data=alldata)
summary(yourmod)

## to do panel models (with 'plm'):
## e.g., a fixed effects model
yourFEmod<-plm(cost~revenue, data=alldata, index=c("id","time"))
## end example ##



Original message:
--
Date: Sun, 19 Apr 2009 12:30:10 +0100
From: "Cecilia Carmo" 
Subject: [R] importing spreadsheet data - linera regression - panel
data
To: r-help@r-project.org
Message-ID: 
Content-Type: text/plain;charset=iso-8859-1;format="flowed"

Hi everyone and thank you for the help you could give me.

My data is in a spreadsheet. The 1st column identifies the 
firm (with the fiscal number), the columns 2 to 11 have 
the variable value for 11 years. I have many variables 
(files like this). Each file has about 40.000 firms 
(rows). I transformed all the files in txt files. The data 
is a panel data, like this:
firmrevenu2007  revenue2006 revenue2005 revenue2004
revenue2003 revenue2002 revenue2001 revenue2000
revenue1999 revenue1998 
500100144

504394029   4282809 3769159 3520807 3548322 3458122

503264032

502011475   2595780 2417433 2299563 2060552 1804531 1821638
1789533 1463371 947712
500400911

504615947   22801   28656   27067   26182   26356   34060
39147   
502616695   1412354 1209619 1429755 1623496 1955123 2273486

[R] what is R best for; what should one learn in addition to R

2009-04-20 Thread Juliet Hannah
Hi,

I've been working with R for a couple of years, and I've
been able to get most of the things done that I needed (sometimes in
a roundabout way). A few experienced statisticians told me that
R is best for interactive data analysis, but for large-scale
computations, one needs something else.

I understand that this all depends on what you are trying to
accomplish, and R offers many ways to make large-scale
computing possible.

I am seeking advice from those of you who do statistical
programming outside of R. What do you use, and what kinds
of applications require you to use something other than R?

I have some experience with Java, C++, and Perl. Where would you
suggest that I concentrate my efforts so that if R does not handle
what I need well, I will be equipped to handle it.

Thanks,

Juliet

__
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] Constraining equality between parameters of multinomial logit regression using VGAM)

2009-04-20 Thread Rémi Kazma
Hello,
I am using the VGAM library to perform a multinomial logistic regression
with 3 outcome categories and a binary independant factor.
How can I contraint the beta

[[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] Constraining equality between parameters of multinomial logit regression using VGAM)

2009-04-20 Thread Rémi Kazma
Hello,
I am using the VGAM library to perform a multinomial logistic regression
with 3 outcome categories and a binary independant factor.
How can I constraint the 2 beta parameters to be equal. I intend to do that
in order to obtain a Log-Likelihood to test against the model with 2
different beta parameters.

This is part of my script :

library(VGAM)
Factor <- c(0,1)
DataSample <- cbind(c(88,75), c(249,88), c(405,95))
Mlogit.fit <- vglm(DataSample ~ Factor, family = multinomial())


Thank you.

[[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] data$ID -> I always get a NULL

2009-04-20 Thread Grześ

Now everything is clear for me. Thanks David! :)


David Winsemius wrote:
> 
> 
> On Apr 20, 2009, at 4:33 AM, Grześ wrote:
> 
>>
>> This is my result:
>>
>>> class(data)
>> [1] "data.frame"
>>
>>> str(data)
>> 'data.frame':2193 obs. of  83 variables:
>> $ X.ID.   : Factor w/ 2193 levels  
>> "'18201'",..:
>> 1 2 3 4 5 6 7 8 9 10 ...
>> $ X.kod.   : Factor w/ 20 levels  
>> "'01'","'02'",..: 1 1
>> 1 1 1 1 1 1 1 1 ...
>> $ X.wiel. : int  7 7 7 7 7 7 7 8 8 8 ...
>> $ X.piech. : num  1 99.9 4 0.5 4 2 99.9 2 2  
>> 99.9 ...
>> $ X.rodz.   : int  NA 2 4 NA 4 2 2 3 2 NA ...
>>
>> David Winsemius wrote:
>>>
>>>
>>> On Apr 19, 2009, at 6:45 PM, Grześ wrote:
>>>

 I have database write as .csv file.
>>>
>>> The external sorage format is not likely to be relevant. What might  
>>> be
>>> informative would be to produce the code that reads this file.

 When I want to get sth from my database I get NULL, but I know that
 there is
 sth!
 For example:

> data$ID
 NULL
> data$kod
 NULL
> 
> So the names of your columns are not "ID" and "kod" but rather "X.ID."  
> and "X.kod."
> 
> Try instead:
>   data$X.ID.
> #and:
>   data$X.kkod. # you will need to use both the periods if your  
> column names end in periods.
> 
> 

 but command like below is always recognize by R
> data[2,3]
 [1] '082'
> 
> 
> That must have been a different version of data, since data[2,3] from  
> the dataframe above should have been   the number 7  number rather  
> than a string. I would also suggest that you start naming your  
> data.frames something other than "data", since that is a reserved word  
> used by quite a few functions.
> 
> 

>>>
>>> Tell is what happens when you enter:
>>>
>>> str(data)
>>> class(data)
>>>
>>> Perhaps the third column is not named "ID" or "kod" or the object is
>>> not a data.frame, but is rather a matrix.
>>>
>>> -- 
>>> David Winsemius


 In my opinion this problem is also connect with my attempt to create
 a tree.
 I always get errors.

> t.tree0=rpart(ID~.,t.train)
 Error in eval(expr, envir, enclos) : object "ID" not found

> t.tree0=rpart(kod~.,t.train)
 Error in eval(expr, envir, enclos) : object "kod" not found

 What I should do to create my simple trees?

> 
 -- 
> 
> David Winsemius, MD
> Heritage Laboratories
> West Hartford, CT
> 
> __
> 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.
> 
> 

-- 
View this message in context: 
http://www.nabble.com/data%24ID--%3E-I-always-get-a-NULL-tp23128214p23139208.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 to force axis to have the same range

2009-04-20 Thread Sebastien Bihorel

Dear R-users,

I am trying to produce (standard and trellis) scatterplots which use the 
same range of the x and y axes. In addition, I would like the plots to 
be physically square. Is there one or more specific argument(s) to plot 
and xyplot what would do that? I have looked at various combinations of 
asp and pin value, but could not get what I wanted..


Thank you in advance for your help

Sebastien

__
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 to force axis to have the same range

2009-04-20 Thread Dieter Menne
Sebastien Bihorel  cognigencorp.com> writes:

> I am trying to produce (standard and trellis) scatterplots which use the 
> same range of the x and y axes. In addition, I would like the plots to 
> be physically square. Is there one or more specific argument(s) to plot 
> and xyplot what would do that? I have looked at various combinations of 
> asp and pin value, but could not get what I wanted..

In lattice : aspect = 1

Dieter

__
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 : PCA and automatic determination of the number of components

2009-04-20 Thread William Revelle


At 12:08 PM + 4/20/09, Jari Oksanen wrote:

justin bem  yahoo.fr> writes:



 See ade4 or mva package.
  Justin BEM
 BP 1917 Yaoundé


I guess the problem was not to find PCA (which is easy to find), but
 finding an automatic method of selecting ("determining" sounds like
that selection would be correct in some objective sense) numbers of
components to be retained. I thin neither ade4 nor mva give much support
here (in particular the latter which does not exist any more).

The usual place to look at is multivariate task view:

http://cran.r-project.org/web/views/Multivariate.html

Under the heading "Projection methods" and there under
"Principal components" the taskview mentions packages
nFactors and paran that help in selecting the number
of components to retain.

Are these Task Views really so invisible in R that people don't find
them? Usually they are the first place to look at when you need
something you don't have. In statistics, I mean. If they are invisible,
could they be made more visible?

Cheers, Jari Oksanen


 
 De : nikolay12  gmail.com>
 À : r-help  r-project.org
 Envoyé le : Lundi, 20 Avril 2009, 4h37mn 41s
 Objet : [R] PCA and automatic determination of the number of components

 Hi all,

 I have relatively small dataset on which I would like to perform a PCA. I am
 interested about a package that would also combine a method for determining
 the number of components (I know there are plenty of approaches to this
 problem). Any suggestions about a package/function?

 thanks,

 Nick


___


Henry Kaiser once commented that the "Solving the 
number of factors problem is easy, I do it 
everyday before breakfast. But knowing the right 
solution is harder"


The psych package includes a number of ways to 
determine the number of components.  Parallel 
analysis (comparing your solution to random 
ones), Minimum Absolute Partial correlations, 
Very Simple Structure are three of the better 
ways.  Try functions fa.parallel and VSS.


Bill




--
William Revelle http://personality-project.org/revelle.html
Professor   http://personality-project.org/personality.html
Department of Psychology http://www.wcas.northwestern.edu/psych/
Northwestern University http://www.northwestern.edu/
Attend  ISSID/ARP:2009   http://issid.org/issid.2009/

__
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] doing zero inflated glmm for count data with fmr

2009-04-20 Thread levyofi

Thank you very much Ben.
I took you advice and run the lmer model with family="quasipoisson" and got
sigma~10. I guess this means that the data has overdispertion but not too
high (>15) for me to must use zero inflated model.
Am I right? 
I will also post to the r-sig-mixed-models specialty list...
Cheers,
Ofir.


Ben Bolker wrote:
> 
> 
> 
> levyofi wrote:
>> 
>> Hello R users,
>> Doing My PhD I collected count data which I believe is zero inflated. I
>> have run a statistical model with lmer and family=poisson and got
>> summary(model)@sigma=1 so I believe there is no overdispertion.  
>> 
> 
> You have been misled.  sigma is set to 1 by definition for the Poisson and
> binomial families.
> Try with family="quasipoisson" and see what you get.
> 
> 
> levyofi wrote:
>> 
>> I would like to use the fmr function from the 'gnlm' library but I just
>> cannot figure out from the examples in the help page and some forums out
>> there how to convert the lmer parameters to the one used in fmr...
>> 
>> I have these variables in the model:
>>   count: the number of logs in a foraging tray (this is the response
>> variable).
>>   ta: the ambient temperature at the foraging tray.
>>   habitat: the habitat type of the foraging tray.
>>   season: the season in which the experiment session took place (summer
>> or winter).
>>   moon: the moon phase (new or full).
>>   position: a random factor (I had 4 foraging stations)
>>   individual_id: a random factor indicating the individual foraged in the
>> tray.
>>   
>> This is the lmer parameters I have used:
>> model<-lmer(count~ta*habitat*season*moon + (1|individual_id) +
>> (1|position), data=countdata, family=poisson) 
>> 
> 
> I think (but am not sure) that "fmr" won't do what you want; it will fit
> zero-inflated
> neg binom, but not mixed-effect models.  "gnlm" in Lindsey's repeated
> package does
> mixed-effect models with neg binom, but not zero-inflation.  Are you sure
> you need
> zero-inflation after accounting for random effects?
> 
> glmm.admb in the glmmADMB package will do *most* of what you want, but ...
> not crossed random effects as you have specified above (it only allows for
> a single
> grouping factor, as far as I can see).
> 
> If you really want all of this (zero-inflated negative binomial, crossed
> random
> effects) your choices would seem to be (a) the full version of AD Model
> Builder
> (maybe?) or (b) WinBUGS ...
> 
>   I would strongly recommend that you forward further queries on this
> to the r-sig-mixed-models specialty list ...
> 
>   cheers
> Ben Bolker
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/doing-zero-inflated-glmm-for-count-data-with-fmr-tp23136570p23140450.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] How to force axis to have the same range

2009-04-20 Thread David Winsemius


On Apr 20, 2009, at 12:18 PM, Dieter Menne wrote:


Sebastien Bihorel  cognigencorp.com> writes:

I am trying to produce (standard and trellis) scatterplots which  
use the
same range of the x and y axes. In addition, I would like the plots  
to
be physically square. Is there one or more specific argument(s) to  
plot
and xyplot what would do that? I have looked at various  
combinations of

asp and pin value, but could not get what I wanted..


In lattice : aspect = 1


To satisfy both of his requests with xyplot, I think he also needs  
xlim and ylim:


 xy <-data.frame(x=1:10, y= rnorm(10)+5)
 xyplot(y ~ x, data=xy, aspect=1)
 xyplot(y ~ x, data=xy, aspect=1, ylim=c(0,11), xlim=c(0,11))

I was less successful in using xlim and ylim with plot, since it seems  
to handle the x-axis differently than the y-axis as far as padding out  
beyond the limits. I would typically need to set asp=0.85 to get what  
looked to ba a square plot. Suggest reading the documentation for  
plot.window() as a start.


--

David Winsemius, MD
Heritage Laboratories
West Hartford, CT

__
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] bug when subtracting decimals?

2009-04-20 Thread Dieter Menne
wolfgang.siewert  gmail.com> writes:

> There is a way around: 
> round(0.7-0.3,1)==0.4
> (TRUE)
> 
> Obviously there is a problem with some combinations of decimal subtractions,
> that - we have the feeling - shouldt be solved.

Oh no, not that one again! This was lecture two in my first computer
course in 1968, but it seems to be gone the way of the dodo since than.

Dietr

__
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] drawing data structures

2009-04-20 Thread Greg Snow
I am not sure that I fully understand what you want, but look at the TkListView 
function in the TeachingDemos package for one possible solution.  If that is 
not what you meant, then a better problem description will help us to help you.

-- 
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.s...@imail.org
801.408.8111


> -Original Message-
> From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-
> project.org] On Behalf Of rajesh j
> Sent: Sunday, April 19, 2009 10:37 AM
> To: r-help@r-project.org
> Subject: [R] drawing data structures
> 
> Hi,
> I need to represent data structures in a figure.stuff like trees with
> nodes
> and pointers etc.can someone guide me to a package that does this?
> 
> --
> Rajesh.J
> 
>   [[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] Re : PCA and automatic determination of the number of components

2009-04-20 Thread Stéphane Dray
ade4 has the 'testdim' function which implements a recent method for 
estimating the number of dimension for PCA on correlation matrix. Paper 
describing the approach is available at 
http://pbil.univ-lyon1.fr/members/dray/articles/SD805.php





William Revelle wrote:


At 12:08 PM + 4/20/09, Jari Oksanen wrote:

justin bem  yahoo.fr> writes:



 See ade4 or mva package.
  Justin BEM
 BP 1917 Yaoundé


I guess the problem was not to find PCA (which is easy to find), but
 finding an automatic method of selecting ("determining" sounds like
that selection would be correct in some objective sense) numbers of
components to be retained. I thin neither ade4 nor mva give much support
here (in particular the latter which does not exist any more).

The usual place to look at is multivariate task view:

http://cran.r-project.org/web/views/Multivariate.html

Under the heading "Projection methods" and there under
"Principal components" the taskview mentions packages
nFactors and paran that help in selecting the number
of components to retain.

Are these Task Views really so invisible in R that people don't find
them? Usually they are the first place to look at when you need
something you don't have. In statistics, I mean. If they are invisible,
could they be made more visible?

Cheers, Jari Oksanen


 
 De : nikolay12  gmail.com>
 À : r-help  r-project.org
 Envoyé le : Lundi, 20 Avril 2009, 4h37mn 41s
 Objet : [R] PCA and automatic determination of the number of 
components


 Hi all,

 I have relatively small dataset on which I would like to perform a 
PCA. I am
 interested about a package that would also combine a method for 
determining
 the number of components (I know there are plenty of approaches to 
this

 problem). Any suggestions about a package/function?

 thanks,

 Nick


___


Henry Kaiser once commented that the "Solving the number of factors 
problem is easy, I do it everyday before breakfast. But knowing the 
right solution is harder"


The psych package includes a number of ways to determine the number of 
components.  Parallel analysis (comparing your solution to random 
ones), Minimum Absolute Partial correlations, Very Simple Structure 
are three of the better ways.  Try functions fa.parallel and VSS.


Bill






--
Stéphane DRAY (d...@biomserv.univ-lyon1.fr )
Laboratoire BBE-CNRS-UMR-5558, Univ. C. Bernard - Lyon I
43, Bd du 11 Novembre 1918, 69622 Villeurbanne Cedex, France
Tel: 33 4 72 43 27 57   Fax: 33 4 72 43 13 88
http://pbil.univ-lyon1.fr/members/dray/

__
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] automatic exploration of all possible loglinear models?

2009-04-20 Thread Christopher W. Ryan
Is there a way to automate fitting and assessing loglinear models for
several nominal variables . . . something akin to step or drop1 or add1
for linear or logistic regression?

Thanks.

--Chris
-- 
Christopher W. Ryan, MD
SUNY Upstate Medical University Clinical Campus at Binghamton
40 Arch Street, Johnson City, NY  13790
cryanatbinghamtondotedu

"If you want to build a ship, don't drum up the men to gather wood,
divide the work and give orders. Instead, teach them to yearn for the
vast and endless sea."  [Antoine de St. Exupery]

__
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 run to multinomial PLS regression in R?

2009-04-20 Thread Max Kuhn
There are functions in the caret package to do classification with pls
and spls, if that is what you mean. They are plsda and splsda.

-- 

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] what is R best for; what should one learn in addition to R

2009-04-20 Thread Stefan Grosse
On Mon, 20 Apr 2009 11:49:29 -0400 Juliet Hannah
 wrote:

JH> I've been working with R for a couple of years, and I've
JH> been able to get most of the things done that I needed (sometimes in
JH> a roundabout way). A few experienced statisticians told me that
JH> R is best for interactive data analysis, but for large-scale
JH> computations, one needs something else.

Depends on what is meant by large-scale computations and you yourself
intend to do. I know of people doing optimization stuff which needs a
lot of computational power. They use Matlab since it is easy for them
to use multiple processors (+multiple pc's). R at the moment only uses
one processor and also does not yet (there is a project working on it)
something like just in time compilation which appears to be in Matlab. 

However R is for free and flexible so there are ways to deal with some
analysis that need more computational power. 

my 2c
Stefan

__
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] Random Forests: Question about R^2

2009-04-20 Thread Dimitri Liakhovitski
I would like to summarize. Would you please confirm that my summary is
correct? Thank you very much!

Determining R^2 in Random Forests (for a Regression Forest):

1. For each individual case, record a mean prediction on the dependent
variable y across all trees for which the case is OOB (Out-of-Bag);
2. For each individual case, calculate a residual: residual = observed
y - mean predicted y (from step 1)
3. Calculate mean square residual MSE: MSE = sum of all individual
residuals (from step 2) / n
4. Because MSE/var(y) represents the proportion of y variance that is
due to error, then R^2 = 1 - MSE/var(y).

If it's correct, my last question would be:
I am getting as many R^2 as the number of trees because each time the
residuals are recalculated using all trees built so far, correct?

Thank you very much!
Dimitri


On Mon, Apr 13, 2009 at 6:22 PM, Liaw, Andy  wrote:
> Apologies: that should have been sum(residual^2)!
>
>> -Original Message-
>> From: Dimitri Liakhovitski [mailto:ld7...@gmail.com]
>> Sent: Monday, April 13, 2009 4:35 PM
>> To: Liaw, Andy
>> Cc: R-Help List
>> Subject: Re: [R] Random Forests: Question about R^2
>>
>> Andy,
>> thank you very much!
>> One clarification question:
>>
>> If MSE = sum(residuals) / n, then
>> in the formula (1 - mse / Var(y)) - shouldn't one square mse before
>> dividing by variance?
>>
>> Dimitri
>>
>>
>> On Mon, Apr 13, 2009 at 10:52 AM, Liaw, Andy
>>  wrote:
>> > MSE is the mean squared residuals.  For the training data, the OOB
>> > estimate is used (i.e., residual = data - OOB prediction, MSE =
>> > sum(residuals) / n, OOB prediction is the mean of
>> predictions from all
>> > trees for which the case is OOB).  It is _not_ the average
>> OOB MSE of
>> > trees in the forest.
>> >
>> > I hope there's no question about how the pseudo R^2 is computed on a
>> > test set?  If you understand how that's done, I assume the
>> confusion is
>> > only how the OOB MSE is formed.
>> >
>> > Best,
>> > Andy
>> >
>> > From: Dimitri Liakhovitski
>> >>
>> >> Dear Random Forests gurus,
>> >>
>> >> I have a question about R^2 provided by randomForest (for
>> regression).
>> >> I don't succeed in finding this information.
>> >>
>> >> In the help file for randomForest under "Value" it says:
>> >>
>> >> rsq: (regression only) - "pseudo R-squared'': 1 - mse / Var(y).
>> >>
>> >> Could someone please explain in somewhat more detail how
>> exactly R^2
>> >> is calculated?
>> >> Is "mse" mean squared error for prediction?
>> >> Is "mse" an average of mse's for all trees run on out-of-bag
>> >> holdout samples?
>> >> In other words - is this R^2 based on out-of-bag samples?
>> >>
>> >> Thank you very much for clarification!
>> >>
>> >> --
>> >> Dimitri Liakhovitski
>> >> MarketTools, Inc.
>> >> dimitri.liakhovit...@markettools.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.
>> >>
>> > Notice:  This e-mail message, together with any
>> attachments, contains
>> > information of Merck & Co., Inc. (One Merck Drive,
>> Whitehouse Station,
>> > New Jersey, USA 08889), and/or its affiliates (which may be known
>> > outside the United States as Merck Frosst, Merck Sharp & Dohme or
>> > MSD and in Japan, as Banyu - direct contact information for
>> affiliates is
>> > available at http://www.merck.com/contact/contacts.html) that may be
>> > confidential, proprietary copyrighted and/or legally
>> privileged. It is
>> > intended solely for the use of the individual or entity
>> named on this
>> > message. If you are not the intended recipient, and have
>> received this
>> > message in error, please notify us immediately by reply e-mail and
>> > then delete it from your system.
>> >
>> >
>>
>>
>>
>> --
>> Dimitri Liakhovitski
>> MarketTools, Inc.
>> dimitri.liakhovit...@markettools.com
>>
> Notice:  This e-mail message, together with any attachments, contains
> information of Merck & Co., Inc. (One Merck Drive, Whitehouse Station,
> New Jersey, USA 08889), and/or its affiliates (which may be known
> outside the United States as Merck Frosst, Merck Sharp & Dohme or
> MSD and in Japan, as Banyu - direct contact information for affiliates is
> available at http://www.merck.com/contact/contacts.html) that may be
> confidential, proprietary copyrighted and/or legally privileged. It is
> intended solely for the use of the individual or entity named on this
> message. If you are not the intended recipient, and have received this
> message in error, please notify us immediately by reply e-mail and
> then delete it from your system.
>
>



-- 
Dimitri Liakhovitski
MarketTools, Inc.
dimitri.liakhovit...@markettools.com

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-h

[R] Sweave and executive summaries - WORK AROUND

2009-04-20 Thread Karen_Byron

__
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 : PCA and automatic determination of the number of components

2009-04-20 Thread nikolay12

Thanks to all for the suggestions. 

Are you aware of a convenient implementation of AIC/BIC for the problem of
selecting the number of factors?

Nick


William Revelle wrote:
> 
> 
> At 12:08 PM + 4/20/09, Jari Oksanen wrote:
>>justin bem  yahoo.fr> writes:
>>
>>>
>>>  See ade4 or mva package.
>>>   Justin BEM
>>>  BP 1917 Yaoundé
>>>
>>I guess the problem was not to find PCA (which is easy to find), but
>>  finding an automatic method of selecting ("determining" sounds like
>>that selection would be correct in some objective sense) numbers of
>>components to be retained. I thin neither ade4 nor mva give much support
>>here (in particular the latter which does not exist any more).
>>
>>The usual place to look at is multivariate task view:
>>
>>http://cran.r-project.org/web/views/Multivariate.html
>>
>>Under the heading "Projection methods" and there under
>>"Principal components" the taskview mentions packages
>>nFactors and paran that help in selecting the number
>>of components to retain.
>>
>>Are these Task Views really so invisible in R that people don't find
>>them? Usually they are the first place to look at when you need
>>something you don't have. In statistics, I mean. If they are invisible,
>>could they be made more visible?
>>
>>Cheers, Jari Oksanen
>>
>>>  
>>>  De : nikolay12  gmail.com>
>>>  À : r-help  r-project.org
>>>  Envoyé le : Lundi, 20 Avril 2009, 4h37mn 41s
>>>  Objet : [R] PCA and automatic determination of the number of components
>>>
>>>  Hi all,
>>>
>>>  I have relatively small dataset on which I would like to perform a PCA.
>>> I am
>>>  interested about a package that would also combine a method for
>>> determining
>>>  the number of components (I know there are plenty of approaches to this
>>>  problem). Any suggestions about a package/function?
>>>
>>>  thanks,
>>>
>>>  Nick
>>
>>___
> 
> Henry Kaiser once commented that the "Solving the 
> number of factors problem is easy, I do it 
> everyday before breakfast. But knowing the right 
> solution is harder"
> 
> The psych package includes a number of ways to 
> determine the number of components.  Parallel 
> analysis (comparing your solution to random 
> ones), Minimum Absolute Partial correlations, 
> Very Simple Structure are three of the better 
> ways.  Try functions fa.parallel and VSS.
> 
> Bill
> 
> 
> 
> 
> -- 
> William Revelle   http://personality-project.org/revelle.html
> Professor http://personality-project.org/personality.html
> Department of Psychology
> http://www.wcas.northwestern.edu/psych/
> Northwestern University   http://www.northwestern.edu/
> Attend  ISSID/ARP:2009   http://issid.org/issid.2009/
> 
> __
> 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.
> 
> 

-- 
View this message in context: 
http://www.nabble.com/PCA-and-automatic-determination-of-the-number-of-components-tp23129941p23140613.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] generic genotype calling algorithm?

2009-04-20 Thread Nigel Birney

Hi, 

I have Agilent and Illumina SNP data. That's the only thing I know about the
files - there seem to be no version specification in any of them. 

Is there a generic genotype calling algorithm that I could try to use on
these datasets?

thanks,
N.

-- 
View this message in context: 
http://www.nabble.com/generic-genotype-calling-algorithm--tp23141124p23141124.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] SEM package

2009-04-20 Thread Tijana Gonja

Hi

I tried to install the sem package and it was succsessful but I keep 
getting the following message


Paket 'sem' erfolgreich ausgepackt und MD5 Summen abgeglichen

Die heruntergeladenen Pakete sind in
   C:\Users\Dean\AppData\Local\Temp\RtmpVRxlLZ\downloaded_packages
aktualisiere HTML Paketbeschreibungen
Warning message:
In file.create(f.tg) :
 kann Datei 'C:\PROGRA~1\R\R-28~1.1/doc/html/packages.html' nicht 
erzeugen. Grund '*Permission denied*'


How can I get this permission what can I do?

Thank you
Nina

__
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] RES: How to force axis to have the same range

2009-04-20 Thread Rodrigo Aluizio
Hi Sebastien, take a look at the par(pty='s') argument. Maybe its can solve
your issue.

Best wishes.

Rodrigo.

-Mensagem original-
De: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] Em
nome de Sebastien Bihorel
Enviada em: segunda-feira, 20 de abril de 2009 12:26
Para: R-help
Assunto: [R] How to force axis to have the same range

Dear R-users,

I am trying to produce (standard and trellis) scatterplots which use the 
same range of the x and y axes. In addition, I would like the plots to 
be physically square. Is there one or more specific argument(s) to plot 
and xyplot what would do that? I have looked at various combinations of 
asp and pin value, but could not get what I wanted..

Thank you in advance for your help

Sebastien

__
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] what is R best for; what should one learn in addition to R

2009-04-20 Thread Josh Stumpf
You might also try looking in to Python. It has lots of mathematical and
computational libraries (numpy and scipy are particularly useful), as well
some to deal with concurrency (e.g. Parallel Python), and can interact with
R (rpy and rpy2).
Josh Stumpf



On Mon, Apr 20, 2009 at 8:49 AM, Juliet Hannah wrote:

> Hi,
>
> I've been working with R for a couple of years, and I've
> been able to get most of the things done that I needed (sometimes in
> a roundabout way). A few experienced statisticians told me that
> R is best for interactive data analysis, but for large-scale
> computations, one needs something else.
>
> I understand that this all depends on what you are trying to
> accomplish, and R offers many ways to make large-scale
> computing possible.
>
> I am seeking advice from those of you who do statistical
> programming outside of R. What do you use, and what kinds
> of applications require you to use something other than R?
>
> I have some experience with Java, C++, and Perl. Where would you
> suggest that I concentrate my efforts so that if R does not handle
> what I need well, I will be equipped to handle it.
>
> Thanks,
>
> Juliet
>
> __
> 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.
>



-- 
"Despair leads to boredom, electronic games, computer hacking, poetry, and
other bad habits." --Ed Abbey

"Masochism is a valuable job skill. ." --Chuck Palahniuk

"It is by caffeine alone I set my mind in motion. It is by the beans of Java
that my thoughts acquire speed. My hands acquire shaking, the shaking
becomes a warning. It is by caffeine alone I set my mind in motion..."

[[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] what is R best for; what should one learn in addition to R

2009-04-20 Thread David M Smith
On Mon, Apr 20, 2009 at 10:37 AM, Stefan Grosse  wrote:
> I know of people doing optimization stuff which needs a
> lot of computational power. They use Matlab since it is easy for them
> to use multiple processors (+multiple pc's). R at the moment only uses
> one processor and also does not yet (there is a project working on it)
> something like just in time compilation which appears to be in Matlab.

R can already use multiple processors. Some builds of R, and all
builds of REvolution R, use mathematical libraries which will run many
computations in parallel on multiprocessor/multicore machines.

It's equally possible to run computations on multiple machines (e.g.
clusters) with packages like ParallelR or snow. (I don't know how easy
this is in Matlab, but it's pretty easy with R.)

Parallel and distributed computing can often help where the
computation runs in R, but takes a long time to complete. A separate
issue is one where the data size is very large, in which case you may
want to consider a 64-bit build of R (we just released one for Windows
- see http://tinyurl.com/cuec9g [blog.revolution-computing.com]) or
using a package like bigmemory or biglm.

# David Smith

--
David M Smith 
Director of Community, REvolution Computing www.revolution-computing.com
Tel: +1 (206) 577-4778 x3203 (San Francisco, USA)

Check out our upcoming events schedule at www.revolution-computing.com/events

__
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] SEM package

2009-04-20 Thread Dimitri Liakhovitski
Nina,
did you try to install this package using some other mirror?
Dimitri

On Mon, Apr 20, 2009 at 1:35 PM, Tijana Gonja  wrote:
> Hi
>
> I tried to install the sem package and it was succsessful but I keep getting
> the following message
>
> Paket 'sem' erfolgreich ausgepackt und MD5 Summen abgeglichen
>
> Die heruntergeladenen Pakete sind in
>       C:\Users\Dean\AppData\Local\Temp\RtmpVRxlLZ\downloaded_packages
> aktualisiere HTML Paketbeschreibungen
> Warning message:
> In file.create(f.tg) :
>  kann Datei 'C:\PROGRA~1\R\R-28~1.1/doc/html/packages.html' nicht erzeugen.
> Grund '*Permission denied*'
>
> How can I get this permission what can I do?
>
> Thank you
> Nina
>
> __
> 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.
>



-- 
Dimitri Liakhovitski
MarketTools, Inc.
dimitri.liakhovit...@markettools.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] R graph into MS Word: which format to use?

2009-04-20 Thread Mark Wardle
They may stipulate word files for the manuscript, but during
submission, journals usually request EPS or PDF formats. In fact, all
I've dealt with stipulate NEVER include graphcis into a Word document.

May be worth checking again!

Mark

2009/4/20 jjh21 :
>
> Hello,
>
> The journal I am publishing in requires MS Word files. What is my best
> option for getting a high quality image of a graph done in R into Word?
> JPEG? Postscript?
>
> Thanks.
> --
> View this message in context: 
> http://www.nabble.com/R-graph-into-MS-Word%3A-which-format-to-use--tp23133745p23133745.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.
>
>



-- 
Dr. Mark Wardle
Specialist registrar, Neurology
Cardiff, UK

__
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] Random Forests: Predictor importance for Regression Trees

2009-04-20 Thread Dimitri Liakhovitski
Hello!

I think I am relatively clear on how predictor importance (the first
one) is calculated by Random Forests for a Classification tree:

Importance of predictor P1 when the response variable is categorical:

1. For out-of-bag (oob) cases, randomly permute their values on
predictor P1 and then put them down the tree
2. For a given tree, subtract the number of votes for the correct
class in the predictor-P1-permuted oob dataset from the number of
votes for the correct class in the untouched oob dataset: if P1 is
important, this number will be large.
3. The average of this number over all trees in the forest is the raw
importance score for predictor P1.

I am wondering what step 2 above looks like if the response variable
is continous and not categorical, in other words - for a Regression
tree. Could you please correct if what I wrote below is wrong? Thank
you very much!

Importance of predictor P1 when the response variable is continous:

1. For out-of-bag (oob) cases, randomly permute their values on
predictor P1 and then put them down the tree
2. For a given tree, calculate mean squared deviation of observed y
minus predicted y for (a) the untouched oob dataset and for (b) the
predictor-P1-permuted oob dataset. Subtract (a) from (b).
3. The average of this number over all trees in the forest is the raw
importance score for predictor P1.

-- 
Dimitri Liakhovitski
MarketTools, Inc.
dimitri.liakhovit...@markettools.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] R Golf?

2009-04-20 Thread Lauri Nikkinen
Hello,

This is probably off-topic but have the R community ever organized R
Golf contents similar to Perl Golf: http://perlgolf.sourceforge.net/ ?
It would be nice to see how R gurus solve problems in many different
ways (although you see it at this list every day :-)).

Regards,
-L

__
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] Calling objects in a loop

2009-04-20 Thread Duncan Murdoch

On 4/20/2009 2:35 PM, Brendan Morse wrote:

Hi everyone, I am trying to calculate a particular variable (vector) from
some previously defined variables in a loop but I am having trouble figuring
out how to get the loop to recognize that it should index for the previously
defined objects. Here is a simplified version of what I am trying to do:

for(i in 1:10){

assign(paste("theta1_",i,sep=""),data.frame(scale(rnorm(250

assign(paste("theta2_",i,sep=""),data.frame(scale(rnorm(250
  assign(paste("theta3_",i,sep=""),data.frame(theta1_i +
theta2_i)
   }

I am having trouble with getting it to recognize that theta3_i should be
calculated using theta1_i and theta2_i in the third line. In other words,
theta3_1 should equal theta1_1+theta2_1 whereas theta3_2 should equal
theta1_2+theta2_2

Any advice as to where I am losing this one?


You have no variables theta1_i and theta2_i.  You would have to 
construct the names and use get() to get the associated values.  But why 
make your life so complicated?  Why not just store everything in lists, 
indexed by i?  E.g.


theta1 <- list()
theta2 <- list()
theta3 <- list()
for (i in 1:10) {
  theta1[[i]] <- data.frame(scale(rnorm(250)))
  etc.

(You could even put everything in a single list of lists, but I don't 
think that makes it easier to read.)


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] Calling objects in a loop

2009-04-20 Thread Dimitri Liakhovitski
Brendan,

I think you should create objects outside of the "for" loop. You can't
create objects instide the loop. You can try this:

metalist1<-list()
for(i in 1:10) 
{metalist1[[i]]<-assign(paste("theta1_",i,sep=""),data.frame(scale(rnorm(250}
lapply(metalist1,function(x){print(dim(x))}) # Checking it out

metalist2<-list()
for(i in 1:10) 
{metalist2[[i]]<-assign(paste("theta1_",i,sep=""),data.frame(scale(rnorm(250}
lapply(metalist1,function(x){print(dim(x))}) # Checking it out

metalist3<-list()
for(i in 1:10) {metalist3[[i]]<-metalist1[[i]]+metalist2[[i]]}
lapply(metalist3,function(x){print(dim(x))}) # Checking it out

# Checking
sum(metalist1[[1]]+metalist2[[1]])
sum(metalist3[[1]])

Dimitri

On Mon, Apr 20, 2009 at 2:35 PM, Brendan Morse  wrote:
> Hi everyone, I am trying to calculate a particular variable (vector) from
> some previously defined variables in a loop but I am having trouble figuring
> out how to get the loop to recognize that it should index for the previously
> defined objects. Here is a simplified version of what I am trying to do:
>
> for(i in 1:10){
>
> assign(paste("theta1_",i,sep=""),data.frame(scale(rnorm(250
>
> assign(paste("theta2_",i,sep=""),data.frame(scale(rnorm(250
>                      assign(paste("theta3_",i,sep=""),data.frame(theta1_i +
> theta2_i)
>                   }
>
> I am having trouble with getting it to recognize that theta3_i should be
> calculated using theta1_i and theta2_i in the third line. In other words,
> theta3_1 should equal theta1_1+theta2_1 whereas theta3_2 should equal
> theta1_2+theta2_2
>
> Any advice as to where I am losing this one?
>
> Thanks,
> brendan
>
>        [[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.
>



-- 
Dimitri Liakhovitski
MarketTools, Inc.
dimitri.liakhovit...@markettools.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] graph with 15 combinations

2009-04-20 Thread Penner, Johannes
Dear R helpers,

I have a data set with 4 types (W, C, E & S). Now I have values for all
types plus all possible combinations (the order is unimportant): W, C,
WC, E, WE, CE, WCE, S, WS, CS, WCS, ES, WES, CES & WCES. Ideally I would
like to represent everything in one graph and as concise as possible.
Drawing 4 circles and depicting it as overlap just gives me 13 out of
the 15 possibilities needed (as e.g. depicted here
http://www.psy.ritsumei.ac.jp/~akitaoka/classic9e.html in the graph
"Four circles surrounding illusion").

Does anybody has a nice solution, ideally with a possible solution in R?

Thanks in advance!
Johannes

--
Project Coordinator BIOTA West Amphibians

Museum of Natural History
Dep. of Research (Herpetology)
Invalidenstrasse 43
D-10115 Berlin
Tel: +49 (0)30 2093 8708
Fax: +49 (0)30 2093 8565

http://www.biota-africa.org
http://community-ecology.biozentrum.uni-wuerzburg.de

__
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] Matrix package,solve() errors and crashes

2009-04-20 Thread Surendar Swaminathan
Hello All,

  I am working on graph object using IGRAPH package wanted to do Bonacich
Power.  This is my graph object.

The file 'Graph.RData' (4.2 MB) is available for download at
http://dropbox.unl.edu/uploads/20090424/cfe4fcb854bb17f2/Graph.RData

Graph size

Vertices: 20984
Edges: 326033
Directed: FALSE
No graph attributes.
Vertex attributes: name.
No edge attributes.

When I use bonacich power it goes out of memory

Error in get.adjacency.dense(graph, type = type, attr = attr, names =
names,  :
  At vector.pmt:409 : cannot reserve space for vector, Out of memory

I got help from IGRAPH community to use sparse Matrix

http://igraph.wikidot.com/r-recipes#toc6

bonpow.sparse <- function(graph, nodes=V(graph), loops=FALSE,
  exponent=1, rescale=FALSE, tol=1e-07) {

  ## remove loops if requested
  if (!loops) {
graph <- simplify(graph, remove.multiple=FALSE, remove.loops=TRUE)
  }

  ## sparse adjacency matrix
  d <- get.adjacency(graph, sparse=TRUE)

  ## sparse identity matrix
  id <- spMatrix(vcount(graph), vcount(graph),
 i=1:vcount(graph), j=1:vcount(graph),
 x=rep(1, vcount(graph)))
  id <- as(id, "dgCMatrix")

  ## solve it
  ev <- solve(id - exponent * d, tol=tol) %*% degree(graph, mode="out")

  if (rescale) {
ev <- ev/sum(ev)
  } else {
ev <- ev * sqrt(vcount(graph)/sum((ev)^2))
  }

  ev[as.numeric(nodes) + 1]
}

## test graph
test.g <- simplify(ba.game(1000,m=2))

## test run
system.time(bp1 <- bonpow(test.g))
system.time(bp2 <- bonpow.sparse(test.g))

## check that they are the same
max(abs(bp1-bp2)) I get following error and sometime it crashes.

In solve(id - exponent * d, tol = tol) :
Reached total allocation of 1535Mb: see help(memory.size).I increased the
memory size and still it is not helpful

Help on this would be great.

These are steps I followed

1. Created graph object using Igraph version 0.6 on R 2.8.1 windows XP
2. Bonpow(g)
3. Bonpow.sparse function

sessionInfo()

R version 2.8.1 (2008-12-22)
i386-pc-mingw32
locale:
LC_COLLATE=English_United States.1252;LC_CTYPE=English_United
States.1252;LC_MONETARY=English_United
States.1252;LC_NUMERIC=C;LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics  grDevices utils datasets  methods   base
other attached packages:
[1] Matrix_0.999375-23 lattice_0.17-20igraph_0.6
loaded via a namespace (and not attached):
[1] grid_2.8.1

Thanks in advance

Nathan

[[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] Calling objects in a loop

2009-04-20 Thread Jorge Ivan Velez
Hi Brendan,
If you really, really want to work with the for() loop, then

for(i in 1:10){
assign(paste("theta1_",i,sep=""),data.frame(scale(rnorm(250
assign(paste("theta2_",i,sep=""),data.frame(scale(rnorm(250
assign(paste("theta3_",i,sep=""), get(paste("theta1_",i,sep=""))
+ get(paste("theta2_",i,sep="")))
}

should work. I would rather prefer to work with list() as Duncan Murdoch
and Dimitri Liakhovitski pointed out.

See ?get for more details.

HTH,

Jorge


On Mon, Apr 20, 2009 at 2:35 PM, Brendan Morse wrote:

> Hi everyone, I am trying to calculate a particular variable (vector) from
> some previously defined variables in a loop but I am having trouble
> figuring
> out how to get the loop to recognize that it should index for the
> previously
> defined objects. Here is a simplified version of what I am trying to do:
>
> for(i in 1:10){
>
> assign(paste("theta1_",i,sep=""),data.frame(scale(rnorm(250
>
> assign(paste("theta2_",i,sep=""),data.frame(scale(rnorm(250
>  assign(paste("theta3_",i,sep=""),data.frame(theta1_i +
> theta2_i)
>   }
>
> I am having trouble with getting it to recognize that theta3_i should be
> calculated using theta1_i and theta2_i in the third line. In other words,
> theta3_1 should equal theta1_1+theta2_1 whereas theta3_2 should equal
> theta1_2+theta2_2
>
> Any advice as to where I am losing this one?
>
> Thanks,
> brendan
>
>[[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.
>

[[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] Calling objects in a loop

2009-04-20 Thread Brendan Morse
Hi everyone, I am trying to calculate a particular variable (vector) from
some previously defined variables in a loop but I am having trouble figuring
out how to get the loop to recognize that it should index for the previously
defined objects. Here is a simplified version of what I am trying to do:

for(i in 1:10){

assign(paste("theta1_",i,sep=""),data.frame(scale(rnorm(250

assign(paste("theta2_",i,sep=""),data.frame(scale(rnorm(250
  assign(paste("theta3_",i,sep=""),data.frame(theta1_i +
theta2_i)
   }

I am having trouble with getting it to recognize that theta3_i should be
calculated using theta1_i and theta2_i in the third line. In other words,
theta3_1 should equal theta1_1+theta2_1 whereas theta3_2 should equal
theta1_2+theta2_2

Any advice as to where I am losing this one?

Thanks,
brendan

[[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] bug when subtracting decimals?

2009-04-20 Thread Gavin Simpson

Dieter Menne wrote:

wolfgang.siewert  gmail.com> writes:

There is a way around: 
round(0.7-0.3,1)==0.4

(TRUE)

Obviously there is a problem with some combinations of decimal subtractions,
that - we have the feeling - shouldt be solved.


Oh no, not that one again! This was lecture two in my first computer
course in 1968, but it seems to be gone the way of the dodo since than.


What makes you think that the average useR has had any exposure to 
computer science courses? ;-)


I bemoan the apparent inability of those asking such questions to use 
the resources provided to solve these problems for themselves...


Gavin



Dietr

__
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] what is R best for; what should one learn in addition to R

2009-04-20 Thread Greg Snow
What things you should learn in addition to R depends on what types of things 
you want to do.  But here are some of the programs that I recommend people take 
a look at:

gnuplot
ggobi
Imagemagick
LaTeX
xfig
Make
Emacs (or other programming editor)
SQL
Perl (or other scripting language)
Tk (actually more an extension than a language/package)

I also recommend that people doing statistics know at least the basics of 3 
different stats packages (S-Plus and R don't count as 2 separate packages)

Depending on your situation, some of the above may be useful, others may not.  
And things can change, I find myself using Perl much less than I used to (but 
am still glad to have it as one of my tools).

-- 
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.s...@imail.org
801.408.8111


> -Original Message-
> From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-
> project.org] On Behalf Of Juliet Hannah
> Sent: Monday, April 20, 2009 9:49 AM
> To: r-help@r-project.org
> Subject: [R] what is R best for; what should one learn in addition to R
> 
> Hi,
> 
> I've been working with R for a couple of years, and I've
> been able to get most of the things done that I needed (sometimes in
> a roundabout way). A few experienced statisticians told me that
> R is best for interactive data analysis, but for large-scale
> computations, one needs something else.
> 
> I understand that this all depends on what you are trying to
> accomplish, and R offers many ways to make large-scale
> computing possible.
> 
> I am seeking advice from those of you who do statistical
> programming outside of R. What do you use, and what kinds
> of applications require you to use something other than R?
> 
> I have some experience with Java, C++, and Perl. Where would you
> suggest that I concentrate my efforts so that if R does not handle
> what I need well, I will be equipped to handle it.
> 
> Thanks,
> 
> Juliet
> 
> __
> 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] SEM package

2009-04-20 Thread John Fox
Dear Tijana,

I'm afraid that I can't entirely read the messages, but the problem
doesn't look like it's peculiar to the sem package. It appears as if
the package may have been properly installed but you didn't have
permission to update HTML help links. If that's the case, then you can
still load and use the package. Does it work? 

If you want to reinstall the package and update HTML links that you
should run R with administrator privileges. See

in the R for Windows FAQ.

I hope this helps,
 John

On Mon, 20 Apr 2009 19:35:14 +0200
 Tijana Gonja  wrote:
> Hi
> 
> I tried to install the sem package and it was succsessful but I keep
> getting the following message
> 
> Paket 'sem' erfolgreich ausgepackt und MD5 Summen abgeglichen
> 
> Die heruntergeladenen Pakete sind in
>
C:\Users\Dean\AppData\Local\Temp\RtmpVRxlLZ\downloaded_packages
> aktualisiere HTML Paketbeschreibungen
> Warning message:
> In file.create(f.tg) :
>   kann Datei 'C:\PROGRA~1\R\R-28~1.1/doc/html/packages.html' nicht 
> erzeugen. Grund '*Permission denied*'
> 
> How can I get this permission what can I do?
> 
> Thank you
> Nina
> 
> __
> 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.


John Fox, Professor
Department of Sociology
McMaster University
Hamilton, Ontario, Canada
http://socserv.mcmaster.ca/jfox/

__
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] Is latest R faster?

2009-04-20 Thread Ted Harding
Hi Folks,
I just upgraded R to the latest R version 2.9.0 (2009-04-17)
(from the Debian Etch repository). It seems to me that it
at least starts up much faster than it used to and, though I
don't have comparative timing data for long jobs, also that
it does its work faster. Is that just an impression, or has
something been done to speed things up?

With thnks,
Ted.


E-Mail: (Ted Harding) 
Fax-to-email: +44 (0)870 094 0861
Date: 20-Apr-09   Time: 20:29:44
-- XFMail --

__
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] graph with 15 combinations

2009-04-20 Thread Greg Snow
http://en.wikipedia.org/wiki/Venn_Diagram#Extensions_to_higher_numbers_of_sets

shows a couple of solutions, not in R, but the ideas could be implemented in R.

Hope this helps,

-- 
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.s...@imail.org
801.408.8111


> -Original Message-
> From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-
> project.org] On Behalf Of Penner, Johannes
> Sent: Monday, April 20, 2009 1:04 PM
> To: r-help@r-project.org
> Subject: [R] graph with 15 combinations
> 
> Dear R helpers,
> 
> I have a data set with 4 types (W, C, E & S). Now I have values for all
> types plus all possible combinations (the order is unimportant): W, C,
> WC, E, WE, CE, WCE, S, WS, CS, WCS, ES, WES, CES & WCES. Ideally I
> would
> like to represent everything in one graph and as concise as possible.
> Drawing 4 circles and depicting it as overlap just gives me 13 out of
> the 15 possibilities needed (as e.g. depicted here
> http://www.psy.ritsumei.ac.jp/~akitaoka/classic9e.html in the graph
> "Four circles surrounding illusion").
> 
> Does anybody has a nice solution, ideally with a possible solution in
> R?
> 
> Thanks in advance!
> Johannes
> 
> --
> Project Coordinator BIOTA West Amphibians
> 
> Museum of Natural History
> Dep. of Research (Herpetology)
> Invalidenstrasse 43
> D-10115 Berlin
> Tel: +49 (0)30 2093 8708
> Fax: +49 (0)30 2093 8565
> 
> http://www.biota-africa.org
> http://community-ecology.biozentrum.uni-wuerzburg.de
> 
> __
> 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] bug when subtracting decimals?

2009-04-20 Thread Stephan Kolassa

Hi,

Gavin Simpson wrote:


I bemoan the apparent inability of those asking such questions to use 
the resources provided to solve these problems for themselves...


Looking at all the people who quite obviously do NOT "read the posting 
guide and provide commented, minimal, self-contained, reproducible 
code", I wonder whether the mailing list could be configured to reply to 
each new mail (not replies in a thread) with an automated mail like this:


"Have you read the posting guide and the FAQs? If you do not get a reply 
within two days, you may want to look at both and think about 
reformulating your query. Oh, and while you are at it, look through the 
archives, a lot of questions have already been asked and answered before."


Just a thought,
Stephan

__
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] generic genotype calling algorithm?

2009-04-20 Thread Martin Morgan

Hi Nigel -- ask on the Bioconductor mailing list.

  http://bioconductor.org/docs/mailList.html

Look at their package descriptions.

  http://bioconductor.org/packages/release/Software.html

Martin

Nigel Birney wrote:
Hi, 


I have Agilent and Illumina SNP data. That's the only thing I know about the
files - there seem to be no version specification in any of them. 


Is there a generic genotype calling algorithm that I could try to use on
these datasets?

thanks,
N.




--
Martin Morgan
Computational Biology / Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N.
PO Box 19024 Seattle, WA 98109

Location: Arnold Building M1 B861
Phone: (206) 667-2793

__
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] graph with 15 combinations

2009-04-20 Thread Penner, Johannes
Thanks a lot! That is exactly what I was looking for!

Best wishes
Johannes

--
Project Coordinator BIOTA West Amphibians

Museum of Natural History
Dep. of Research (Herpetology)
Invalidenstrasse 43
D-10115 Berlin
Tel: +49 (0)30 2093 8708
Fax: +49 (0)30 2093 8565

http://www.biota-africa.org
http://community-ecology.biozentrum.uni-wuerzburg.de

-Ursprüngliche Nachricht-
Von: Greg Snow [mailto:greg.s...@imail.org] 
Gesendet: Montag, 20. April 2009 21:30
An: Penner, Johannes; r-help@r-project.org
Betreff: RE: graph with 15 combinations

http://en.wikipedia.org/wiki/Venn_Diagram#Extensions_to_higher_numbers_of_sets

shows a couple of solutions, not in R, but the ideas could be implemented in R.

Hope this helps,

-- 
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.s...@imail.org
801.408.8111


> -Original Message-
> From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-
> project.org] On Behalf Of Penner, Johannes
> Sent: Monday, April 20, 2009 1:04 PM
> To: r-help@r-project.org
> Subject: [R] graph with 15 combinations
> 
> Dear R helpers,
> 
> I have a data set with 4 types (W, C, E & S). Now I have values for all
> types plus all possible combinations (the order is unimportant): W, C,
> WC, E, WE, CE, WCE, S, WS, CS, WCS, ES, WES, CES & WCES. Ideally I
> would
> like to represent everything in one graph and as concise as possible.
> Drawing 4 circles and depicting it as overlap just gives me 13 out of
> the 15 possibilities needed (as e.g. depicted here
> http://www.psy.ritsumei.ac.jp/~akitaoka/classic9e.html in the graph
> "Four circles surrounding illusion").
> 
> Does anybody has a nice solution, ideally with a possible solution in
> R?
> 
> Thanks in advance!
> Johannes
> 
> --
> Project Coordinator BIOTA West Amphibians
> 
> Museum of Natural History
> Dep. of Research (Herpetology)
> Invalidenstrasse 43
> D-10115 Berlin
> Tel: +49 (0)30 2093 8708
> Fax: +49 (0)30 2093 8565
> 
> http://www.biota-africa.org
> http://community-ecology.biozentrum.uni-wuerzburg.de
> 
> __
> 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] R-Squared with biglm?

2009-04-20 Thread Thomas Lumley

On Mon, 20 Apr 2009, Bryan Lim wrote:

I've been working with a rather large data set (~10M rows), and while biglm 
works beautifully for generating coefficients, it does not report an 
r-squared. It does report RSS. Any idea on how one could coax an R-squared out 
of biglm?


Hmm. I don't ever use r-squared, so I didn't implement it. I'll add the null 
model RSS to the output for the next verson

The obvious work-around is to fit a model with only an intercept, and divide 
the RSS for the two models, but that takes twice as long.

The necessary information is all in the QR decomposition, the problem is just 
getting it out. A Horrible Hack is to use the leaps package and do
  leaps:::leaps.from.biglm(model)$nullrss
to get the null model RSS.

   -thomas

Thomas Lumley   Assoc. Professor, Biostatistics
tlum...@u.washington.eduUniversity of Washington, Seattle

__
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] R 2.9.0 MASS package

2009-04-20 Thread Tom La Bone

I can't seem to find MASS for the latest version of R. Is it coming or has
the name of the package changed?

Tom
-- 
View this message in context: 
http://www.nabble.com/R-2.9.0-MASS-package-tp23144198p23144198.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] R 2.9.0 MASS package

2009-04-20 Thread Peter Dalgaard

Tom La Bone wrote:

I can't seem to find MASS for the latest version of R. Is it coming or has
the name of the package changed?

Tom


Where did you look?

It is in the sources (as part of VR), and also in my (SUSE) test builds.

--
   O__   Peter Dalgaard Øster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark  Ph:  (+45) 35327918
~~ - (p.dalga...@biostat.ku.dk)  FAX: (+45) 35327907

__
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 2.9.0 MASS package

2009-04-20 Thread Tom La Bone

In Windows Xp Pro:

R2.8.1 USA(CA1) repository

markerSearchPower
MASS(VR)
MasterBayes


R2.9.0 USA(CA1) repository

markerSearchPower
MasterBayes

MASS is not where it used to be. I checked a couple of other repositories in
the US and got similar results.

Tom





Peter Dalgaard wrote:
> 
> Tom La Bone wrote:
>> I can't seem to find MASS for the latest version of R. Is it coming or
>> has
>> the name of the package changed?
>> 
>> Tom
> 
> Where did you look?
> 
> It is in the sources (as part of VR), and also in my (SUSE) test builds.
> 
> -- 
> O__   Peter Dalgaard Øster Farimagsgade 5, Entr.B
>c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K
>   (*) \(*) -- University of Copenhagen   Denmark  Ph:  (+45) 35327918
> ~~ - (p.dalga...@biostat.ku.dk)  FAX: (+45) 35327907
> 
> __
> 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.
> 
> 

-- 
View this message in context: 
http://www.nabble.com/R-2.9.0-MASS-package-tp23144198p23144721.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] Cross-Correlation function (CCF) issues

2009-04-20 Thread manta

Dear all,
I have two series of returns and I want to find the cross-correlations
between these two series. I know of the ccf, but it does not work as I'd
like

if i type

ccf(x,y,lag.max=20,type="correlation",plot=FALSE)

i got the error message
Error in na.fail.default(ts.intersect(as.ts(x), as.ts(y))) : 
  missing values in object

So i found that somebody suggested to type
ccf(x,y,lag.max=20,type="correlation",na.action=na.contiguous,plot=FALSE)

but in this case I can only get the cross-correlations for four lagsm
whatever series i plug in the ccf functions (i.e. it's not a matter of the
particular series)

Any suggestions?
-- 
View this message in context: 
http://www.nabble.com/Cross-Correlation-function-%28CCF%29-issues-tp23145411p23145411.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] graph with 15 combinations

2009-04-20 Thread Emmanuel Charpentier
Le lundi 20 avril 2009 à 21:04 +0200, Penner, Johannes a écrit :
> Dear R helpers,
> 
> I have a data set with 4 types (W, C, E & S). Now I have values for all
> types plus all possible combinations (the order is unimportant): W, C,
> WC, E, WE, CE, WCE, S, WS, CS, WCS, ES, WES, CES & WCES. Ideally I would
> like to represent everything in one graph and as concise as possible.
> Drawing 4 circles and depicting it as overlap just gives me 13 out of
> the 15 possibilities needed (as e.g. depicted here
> http://www.psy.ritsumei.ac.jp/~akitaoka/classic9e.html in the graph
> "Four circles surrounding illusion").
> 
> Does anybody has a nice solution, ideally with a possible solution in R?

Plot on a torus. Should be trivial in R once you've found the torus
feeder for your printer... :-)

Emmanuel Charpentier

> Thanks in advance!
> Johannes
> 
> --
> Project Coordinator BIOTA West Amphibians
> 
> Museum of Natural History
> Dep. of Research (Herpetology)
> Invalidenstrasse 43
> D-10115 Berlin
> Tel: +49 (0)30 2093 8708
> Fax: +49 (0)30 2093 8565
> 
> http://www.biota-africa.org
> http://community-ecology.biozentrum.uni-wuerzburg.de
> 
> __
> 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 Hexbinplots in 2 columns with a Single Categorical Variable

2009-04-20 Thread Deepayan Sarkar
On Thu, Apr 9, 2009 at 4:18 AM, Stuart Reece  wrote:
> Dear Ladies and Gentlemen,
>
>  I have a fairly large database (N=13,000) and a single main categorical 
> discriminator between the groups.
>
>  I want to look at the time course of a number of continuous biochemical 
> variables over chronologic age.
>
>  Therefore I believe I need to prepare hexbinplots in two columns with simple 
> regression lines in them (with useOuterStrips (in library(latticeExtra) if 
> possible) and also single hexbinplots with two regression lines 
> (panel.lmlines) corresponding to the two groups to facilitate data comparison.
>
>  Tick marks and labels should be off in most panels, and the scale in each 
> row will be different.
>
>  I have some code written for the NHANES dataset in library(hexbin) which 
> almost does this job, but leaves blank paper up the middle of the two columns 
> of panels.
>
>  I have been exploring lattice for this which almost gets me there but not 
> quite.
>
>  The code I have written is as follows.
>
>  I would be ever so grateful for any advice anyone may be able to offer.
>
>  With best wishes,
>
>  Stuart Reece,
>
> Australia.
>
>
>
>
>
> useOuterStrips(hexbinplot(Transferin ~ Age | factor(Race) + factor(Sex), data 
> = NHANES, type = "r",
>
>           aspect = 1,
>
>           scales =
>
>           list(x =
>
>                 list(relation = "free", rot = 0,
>
>                 at=list(TRUE, TRUE, NULL, NULL)),
>
>                y =
>
>                 list(relation = "free", rot = 0,
>
>                 at=list(TRUE, NULL, TRUE, NULL))),
>
>       par.settings =       list(layout.heights = list(axis.panel = rep(c(1, 
> 0),c(1, 1,

You need the same trick for the widths:

  par.settings =
  list(layout.heights = list(axis.panel =
rep(c(1, 0),c(1, 1))),
   layout.widths = list(axis.panel =
rep(c(1, 0),c(1, 1,

> par.strip.text = list(cex = 1)))

-Deepayan

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