Re: [R] geoRglm with factor variable as covariable

2012-10-07 Thread Filoche
Thank you Ruben. You were absolutly right. I'm using trend option now to specify my model. Thank for the help, Phil -- View this message in context: http://r.789695.n4.nabble.com/geoRglm-with-factor-variable-as-covariable-tp4645067p4645310.html Sent from the R help mailing list archive at Na

Re: [R] two indirect effects of path analysis

2012-10-07 Thread yrosseel
On 10/07/2012 02:17 AM, Elaine Kuo wrote: Hello, This is Elaine. I am trying a path analysis using lavaan Package. There are three explanatory variables: X, Z, and M. The response variable is Y. A, b, and c have direct effects on Y. On the other hand, X and Z also have direct effects on M. In

Re: [R] vector is not assigned correctly in for loop

2012-10-07 Thread 周果
Thank you all for helping me out. As Michael points out, I abused the rounding and formatting of print() while debugging. The default number of digits to print is 7 according to ?print.default, which makes floating point numbers to be somewhat plausible for index vector subsetting at first glance:

Re: [R] Test for Random Points on a Sphere

2012-10-07 Thread 周果
Hi Lorenzo, Just a quick thought, the uniform probability density on a unit sphere is 1 / (4pi), what about binning those random points according to their directions and do a chi-square test? Regards, Guo On Sun, Oct 7, 2012 at 2:16 AM, wrote: > "Lorenzo Isella" writes: > > > Dear All, > > I

[R] get: problem with environments

2012-10-07 Thread Martin Ivanov
Dear R users, I am running R-2.15.1 in Linux Slackware64-14.0. Here is my minimal working example: testfun <- function (x) { a <- 0; sapply(X="a", FUN=get, envir=sys.frame(which=x)); } Inside R, that is R called from within a Linux terminal, the following code works: testfun(x=5) print(test

Re: [R] get: problem with environments

2012-10-07 Thread R. Michael Weylandt
On Sun, Oct 7, 2012 at 10:16 AM, Martin Ivanov wrote: > Dear R users, > > I am running R-2.15.1 in Linux Slackware64-14.0. Here is my minimal working > example: > > testfun <- function (x) { > a <- 0; > sapply(X="a", FUN=get, envir=sys.frame(which=x)); > } > > Inside R, that is R called from w

Re: [R] get: problem with environments

2012-10-07 Thread Rui Barradas
Hello, No, I can't confirm the behavior the op sees. I've tried it in an R terminal on ubuntu 12.04, rkward on ubuntu, and RGui on Windows 7. R version 2.15.1. Here's the rkward sessionInfo. sessionInfo() R version 2.15.1 (2012-06-22) Platform: x86_64-pc-linux-gnu (64-bit) locale: [1] LC_CT

Re: [R] get: problem with environments

2012-10-07 Thread arun
Hi, I am getting the same error message as Michael got (R terminal (R 2.15) on Ubuntu 12.04).   testfun(x=5) #Error in sys.frame(which = x) : not that many frames on the stack  print(testfun(x=6)) #Error in sys.frame(which = x) : not that many frames on the stack A.K. - Original Message -

Re: [R] (no subject)

2012-10-07 Thread Rui Barradas
Hello, You must install the appropriate package(s). Try, for instance, install.packages('rugarch') # do this only once And then, every time you start an R session, if you want to use it, library(rugarch) # do this every R session To know more, try help('rugarch') vignette(package = 'ruga

[R] Computing for Data Analysis ~ R

2012-10-07 Thread Brigettebrenda
Do to work schedules, I may have to discontinue. I really like this course and wish to finish. When is this course offered again, and if so, can I take again? Or, do we have to submit my even the hard deadlines? I can continue if we do not have to submit even by the hard deadline. I am t

Re: [R] get: problem with environments

2012-10-07 Thread R. Michael Weylandt
On Sun, Oct 7, 2012 at 12:33 PM, Rui Barradas wrote: > Hello, > > No, I can't confirm the behavior the op sees. > I've tried it in an R terminal on ubuntu 12.04, rkward on ubuntu, and RGui > on Windows 7. R version 2.15.1. > > Here's the rkward sessionInfo. > > sessionInfo() > R version 2.15.1 (20

Re: [R] Presence/ absence data from matrix to single column

2012-10-07 Thread agoijman
The problem with that, is that I just wrote an example of my database, but I have around 250 species and more than 500 sites. In the approach you show me, it looks like I have to enter every species name and sites individually, right? -- View this message in context: http://r.789695.n4.nabble.c

[R] a merge() problem

2012-10-07 Thread Sam Steingold
I know it does not look very good - using the same column names to mean different things in different data frames, but here you go: --8<---cut here---start->8--- > x <- data.frame(a=c(1,2,3),b=c(4,5,6)) > y <- data.frame(b=c(1,2),a=c("a","b")) > merge(x,y,by.x="a

[R] Problem with national characters in main, xlab, ylab with pdf{grDevices} / postscript {grDevices}

2012-10-07 Thread Magdalena A. Tkacz
Hello. I'm trying to make some graphics with nationalized labels (pdf for use in LaTeX document). On console (displayed on screen) using all looks ok: \/ data<-rnorm(100) hist(data,main='Rozkład gęstości punktów', xlab='Wartość na osi y', ylab='Częstość w

Re: [R] get: problem with environments

2012-10-07 Thread Martin Ivanov
Thank You very much for Your replies. Dear Michael, "Does this persist after a new session (perhaps running as R --vanilla) and/or reinstall?" Yes, it does. After running R --vanilla, still there are 4 contexts more on the call stack. "You didn't show us how you tried to use parent.frame()" I

Re: [R] Computing for Data Analysis ~ R

2012-10-07 Thread David Winsemius
This is not the mailing list for any course. -- On Oct 7, 2012, at 12:27 AM, brigettebre...@aol.com wrote: > Do to work schedules, I may have to discontinue. > > I really like this course and wish to finish. When is this course offered > again, and if so, can I take again? > > Or, do we ha

Re: [R] a merge() problem

2012-10-07 Thread Peter Ehlers
On 2012-10-07 08:34, Sam Steingold wrote: I know it does not look very good - using the same column names to mean different things in different data frames, but here you go: --8<---cut here---start->8--- x <- data.frame(a=c(1,2,3),b=c(4,5,6)) y <- data.frame(b

Re: [R] Problem with national characters in main, xlab, ylab with pdf{grDevices} / postscript {grDevices}

2012-10-07 Thread Prof Brian Ripley
'National': not my nation, and none is stated. Somewhere in Eastern Europe ... Poland? Short answer: you need to use a family which contains those glyphs (try family='NimbusSan': the default 'Helvetica' does not) *and* a viewer that uses fonts that do. Longer answer: read ?pdf and ?postscri

[R] Testing volatility cluster (heteroscedasticity) in stock return?

2012-10-07 Thread Eko andryanto Prakasa
Dear All, i want to use garch model in return of stock. and the data should presence volatility cluster (Heteroscedasticity). Do you know how to test volatility cluster (the presence of heteroscedasticity) in series data of stock return in R? Is it using Langrange Multiplier (LM) ARCH test? what

Re: [R] a merge() problem

2012-10-07 Thread arun
Hi, Though, this does give the result you wanted when the column names are the same.  y1<-y  colnames(y1)<-c("a","b") merge(x,y1,by="a",all=TRUE,suffixes=c("",".y")) #  a b  b.y #1 1 4    a #2 2 5    b #3 3 6 A.K. - Original Message - From: Sam Steingold To: r-help@r-project.org Cc:

Re: [R] Testing volatility cluster (heteroscedasticity) in stock return?

2012-10-07 Thread R. Michael Weylandt
Hi Eko, Please don't cross-post to both R-Help and R-SIG-Finance. Michael On Sun, Oct 7, 2012 at 6:49 PM, Eko andryanto Prakasa wrote: > Dear All, > i want to use garch model in return of stock. and the data should presence > volatility cluster (Heteroscedasticity). > Do you know how to test v

Re: [R] a merge() problem

2012-10-07 Thread Peter Ehlers
On 2012-10-07 10:50, arun wrote: Hi, Though, this does give the result you wanted when the column names are the same. y1<-y colnames(y1)<-c("a","b") merge(x,y1,by="a",all=TRUE,suffixes=c("",".y")) # a b b.y #1 1 4a #2 2 5b #3 3 6 A.K. Yes, because 'b' is _not_ a 'by'-name. Pete

Re: [R] Presence/ absence data from matrix to single column

2012-10-07 Thread Rui Barradas
Hello, I haven't been following this thread but apparently the answer to your worries is no. You can use a combination of names() and grep() to sort it out. something like #nms <- names(adat) nms <- c("Year", "Route", "Point", paste0("Sp", 1:250)) pattern <- "^Sp[[:digit:]]+$" whichCols <- g

Re: [R] Testing volatility cluster (heteroscedasticity) in stock return?

2012-10-07 Thread Eko andryanto Prakasa
Hi Michael, I'm sorry for the mistake.. i don't know if it's not permitted to sent the same message to both (r-help and r-sig) Thank's a lot for the information... Eko   - Original Message - From: R. Michael Weylandt To: Eko andryanto Prakasa Cc: "r-help@R-project.org" Sent: Mo

Re: [R] Presence/ absence data from matrix to single column

2012-10-07 Thread arun
Hi, I guess you are not talking about the melt() method. dat1<-read.table(text=" Year    Route    Point    Sp1    Sp2    Sp3 2004    123    123-1    0    1    0 2004    123    123-2    0    1    1 2004    123    123-10    1    1    0 ",header=TRUE,sep="",stringsAsFactors=FALSE) #If all the Sp col

Re: [R] Problem with national characters in main, xlab, ylab with pdf{grDevices} / postscript {grDevices}

2012-10-07 Thread Magdalena A. Tkacz
Hello. Yes, you're right -Poland, Central/Eastern Europe. My apologies - my fault - not to state it directly in post. Than you for your advice, especially concerning viewer (when OS is Win). Under Windows (checked both on english and polish version of OS) works fine with font family you propose

[R] gam error message: matrix not +ve definite

2012-10-07 Thread garth
Hello, I'm running a multimodel analysis which involves fitting several GAM models as implemented in package mgcv. The issue I'm having is that when I try to fit my model, gam gives me the following error message: 'Error in initial.sp(w * X, S, off) : S[[2]] matrix is not +ve definite.' The stra

[R] BioConductor package: 'oligo'

2012-10-07 Thread Johnson, Franklin Theodore
Dear Help, After loading the pd.Citrus library and checking the DataFrame, I ran > the R code for: > > 1) 'oligo' > > > > {> library(pd.citrus) > Loading required package: RSQLite > Loading required package: DBI > > data(pmSequence) > > > show(pmSequence) > DataFrame with 341730 rows and 2 colum

Re: [R] Format of numbers in plotmath expressions.

2012-10-07 Thread William Dunlap
In-line comments below. Bill Dunlap Spotfire, TIBCO Software wdunlap tibco.com > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On > Behalf > Of Rolf Turner > Sent: Friday, October 05, 2012 5:02 PM > To: Uwe Ligges > Cc: r-help@r-project.or

Re: [R] BioConductor package: 'oligo'

2012-10-07 Thread R. Michael Weylandt
Hi Franklin, As you note, this is a bioconductor package, and they have a separate mailing list for support (fully of terribly knowledgeable and responsive folks) I know it's somewhat unpleasant to be told to look elsewhere after you've spent a good amount of time on it already, but I think it's w

Re: [R] gam error message: matrix not +ve definite

2012-10-07 Thread R. Michael Weylandt
On Sun, Oct 7, 2012 at 3:00 PM, garth wrote: > Hello, > > I'm running a multimodel analysis which involves fitting several GAM models > as implemented in package mgcv. The issue I'm having is that when I try to > fit my model, gam gives me the following error message: 'Error in > initial.sp(w * X

Re: [R] Testing volatility cluster (heteroscedasticity) in stock return?

2012-10-07 Thread R. Michael Weylandt
On Sun, Oct 7, 2012 at 7:59 PM, Eko andryanto Prakasa wrote: > Hi Michael, > > I'm sorry for the mistake.. > i don't know if it's not permitted to sent the same message to both (r-help > and r-sig) > Thank's a lot for the information... > > Eko > No worries, it's a common enough first mistak

Re: [R] Presence/ absence data from matrix to single column

2012-10-07 Thread David L Carlson
You should keep the context of your thread intact for those of us using email instead of Nabble. The locations were not listed individually anywhere in the reshape() command. I listed Point as the id variable so reshape would use that to create row names, but if you delete idvar="Point", reshape w

[R] Robust regression for ordered data

2012-10-07 Thread Eiko Fried
I have two regressions to perform - one with a metric DV (-3 to 3), the other with an ordered DV (0,1,2,3). Neither normal distribution not homoscedasticity is given. I have a two questions: (1) Some sources say robust regression take care of both lack of normal distribution and heteroscedasticit

Re: [R] a merge() problem

2012-10-07 Thread Sam Steingold
> * Peter Ehlers [2012-10-07 10:03:42 -0700]: > > On 2012-10-07 08:34, Sam Steingold wrote: >> I know it does not look very good - using the same column names to mean >> different things in different data frames, but here you go: >> --8<---cut here---start->8---

Re: [R] Robust regression for ordered data

2012-10-07 Thread Jeff Newmiller
This does not appear to be a question about R. You should post in a list or forum dedicated to discussing statistics theory, such as stats.stackoverflow.com. --- Jeff NewmillerThe . .

Re: [R] Robust regression for ordered data

2012-10-07 Thread Eiko Fried
Thank you Jeff! Please ignore the first of my two questions then, and apologies for not making it clear that my second question was about R. (2) "Are there ways of using robust regressions with ordered data" ... in R? Thank you On 7 October 2012 18:26, Jeff Newmiller wrote: > This does not ap

Re: [R] Presence/ absence data from matrix to single column

2012-10-07 Thread Andrea Goijman
Ill try this one as well. And I guess the one below is not going to work, because all my species have different names. Thanks! #nms <- names(adat) nms <- c("Year", "Route", "Point", paste0("Sp", 1:250)) pattern <- "^Sp[[:digit:]]+$" whichCols <- grep(pattern, nms) whichNames <- nms[whichCols]

Re: [R] Robust regression for ordered data

2012-10-07 Thread Bert Gunter
Have you checked the Robust task view on CRAN?? Would seem that that should have been the first place to look. -- Bert On Sun, Oct 7, 2012 at 3:30 PM, Eiko Fried wrote: > Thank you Jeff! Please ignore the first of my two questions then, and > apologies for not making it clear that my second ques

Re: [R] Robust regression for ordered data

2012-10-07 Thread Jeff Newmiller
I don't know about the topic of your question. Have you used the RSiteSearch function to research it yourself? --- Jeff NewmillerThe . . Go Live... DCN:Basics: ##.#. ##.

[R] dist based kmeans clustering

2012-10-07 Thread eliza botto
Dear useRs, i have a matrix X and i generated a distance matrix of X, let us call it Y. I did hierarchical clustering of Y and got some results. I just wanted to know that can i use the same distance matrix "Y" in Kmeans clustering? If not, then how can i use my own distance matrix for kmeans

Re: [R] Presence/ absence data from matrix to single column

2012-10-07 Thread Rui Barradas
Hello, If all your species have different names, you can allways try one of 1. if the non-species follow a pattern, negate those columns and you'll have the species columns. 2. are the species the last columns? Use positional referencing. Rui Barradas Em 08-10-2012 00:16, Andrea Goijman escrev

Re: [R] Presence/ absence data from matrix to single column

2012-10-07 Thread arun
HI, Sorry, I complicated a code where it was not required at all. Just using colnames(dat1)[4:6] or names(dat1)[4:6] should work if the species columns are adjacent to each other. reshape(dat1,varying=4:6,v.name="Sp-value",times=colnames(dat1)[4:6],timevar="Sp-name",idvar=c("Year","Route","Po

Re: [R] multinomial MCMCglmm

2012-10-07 Thread Ben Bolker
Vaniscotte gmail.com> writes: > > Dear all, > > I would like to add mixed effects in a multinomial model and I am trying > to use MCMCglmm for that. [snip] > > "ill-conditioned G/R structure: use proper priors if you haven't or > rescale data if you have" > > I guess that the problem com

Re: [R] a merge() problem

2012-10-07 Thread Peter Ehlers
On 2012-10-07 14:44, Sam Steingold wrote: * Peter Ehlers [2012-10-07 10:03:42 -0700]: On 2012-10-07 08:34, Sam Steingold wrote: I know it does not look very good - using the same column names to mean different things in different data frames, but here you go: --8<---cut here---

[R] Removing header from a matrix

2012-10-07 Thread Dereje Bacha
I have three column vectors (X1, X2, X3).      X1  X2  X3    20   25  40    100 90  80 I want to put them as one matrix of dimention 2 by 3,  but remove headers(X1,X2,X3) from the matrix. I wrote as follows U<-cbind (X1,X2,X3) the headers are there. I need help please. Thanks Dereje

Re: [R] Removing header from a matrix

2012-10-07 Thread Jeff Newmiller
You need to clarify what you have and what you want. Please use the dput() function to create a reproducible example that we can enter into R to make suggestions about. [1] There are a couple of possible things that could be going on here, and what you have given so far is ambiguous. [1] http

Re: [R] Removing header from a matrix

2012-10-07 Thread David L Carlson
These are just column names, but if you want to remove them, it is easy: > X1 <- c(20, 100) > X2 <- c(25, 90) > X3 <- c(40, 80) > U <- cbind(X1, X2, X3) > U X1 X2 X3 [1,] 20 25 40 [2,] 100 90 80 > colnames(U) <- NULL > U [,1] [,2] [,3] [1,] 20 25 40 [2,] 100 90 80

[R] nlminb problem, convergence error code = 1

2012-10-07 Thread zugi young
Hi, I was trying to do a multi-level modeling of the data using the nlme package. I encounter the following message: > addRandomSlopeRange<- lme(FAN.range ~ CHN.range + Age + Block.T, data=data.block, random = ~CHN.range|CHI, method = "ML", na.action=na.omit) Error in lme.formula(FAN.range ~ CHN.

Re: [R] a merge() problem

2012-10-07 Thread Prof Brian Ripley
On 08/10/2012 02:57, Peter Ehlers wrote: On 2012-10-07 14:44, Sam Steingold wrote: * Peter Ehlers [2012-10-07 10:03:42 -0700]: On 2012-10-07 08:34, Sam Steingold wrote: I know it does not look very good - using the same column names to mean different things in different data frames, but here

Re: [R] problem with convergence in mle2/optim function

2012-10-07 Thread Adam Zeilinger
Dear R Help, Thank you to those who responded to my questions about mle2/optim convergence. A few responders pointed out that the optim error seems to arise when either one of the probabilities P1, P2, or P3 become negative or infinite. One suggested examining the exponential terms within th

Re: [R] Robust regression for ordered data

2012-10-07 Thread Prof Brian Ripley
On 08/10/2012 00:37, Bert Gunter wrote: Have you checked the Robust task view on CRAN?? Would seem that that should have been the first place to look. It is still a conceptual question. I presume this means an ordered response, and then we need to know what is meant by 'regression'. If you

Re: [R] Reading labels for very large heatmaps

2012-10-07 Thread JIMonroe
Jean, It's definitely bigger now, but my axes are cut-off. As in your example, I had them drawn after generating the heatmap, but the image does not seem to be centered. I think even part of the heatmap is getting cut off, which wasn't happening until I explicitly set the width and height of the

[R] variances of random effects in coxme

2012-10-07 Thread Hugo Varet
Dear R users, I'm using the function coxme of the package coxme in order to build Cox models with complex random effects. Unfortunately, I sometimes get surprising estimations of the variances of the random effects. I ran models with different fixed covariates but always with the same 3 random ef

[R] Error - function join()

2012-10-07 Thread Jhope
Hi R-listers, In plyr I am using coding I have used before but an error seems to be apparent. Has the function "join" been replaced by another word? I tried this before and it didn't work and then worked for me. But now it is not working again. Please advise, Jean > data.to.analyze <- join(res

[R] Reshape2, melt, order of categorical variable and ggplot2

2012-10-07 Thread Stathis Kamperis
Hello everyone, I have the following data frame: > df V1 V2 V3 1 bench1_10 16675 16678 2 bench1_10 16585 16672 3 bench1_100 183924 185563 4 bench1_100 169310 184806 5 bench1_300 514430 516834 6 bench1_300 510743 514062 7 bench1_500 880146 877882 8 bench1_5

[R] How to remove the obs column in R?

2012-10-07 Thread killerkarthick
>From the following image I need to remove the obs column for my documentation purpose.Please reply me.. -- View this message in context: http://r.789695.n4.nabble.com/How-to-remove-the-obs-column-in-R-tp464

[R] Why do I get different results for type III anova using the drop1 or Anova command?

2012-10-07 Thread C. Weiner
Dear experts, I just noticed that I get different results conducting type III anova using drop1 or the Anova command from the car package. I suppose I made a mistake and hope you can offer me some help. I have no idea where I got wrong and would be very grateful for explaination as R is new t

Re: [R] warning in summary(aov())

2012-10-07 Thread Jhope
Thank you Michael, Another new and useful function for me. In brief, str() gave me: $ Aeventexhumed: chr "A" "A" "A" "A" ... $ Aeventexhumed: Factor w/ 4 levels "","A","B","C": 2 2 2 2 2 2 2 2 2 2 ... I think on the data sheet there are two columns for Aeventexhumed and only one of them was

Re: [R] first and second derivative calculation

2012-10-07 Thread jeemba2012
I have a similar problem . Here are functions I know that work properly ## PAnnuity function definition PAnnuity <- function(A,y,m,n) { f<-(A/(y/m))*(1-1/((1+y/m)^n)) } ##BondPrice function BondPrice <- function(c,y,m,n) { B <-100 f<-PAnnuity((c/m)*B,y,m,n) + B /((1+y/m)^n) } My function o

[R] aov() usage

2012-10-07 Thread Jhope
Hi R-listers, I am wondering if the function aov() in plyr is appropriate for two different types of tests: 1) > summary(aov(EDI ~ VegIndex, data=data.to.analyze)) AND 2) > summary(aov(HSuccess ~ VegIndex + Aeventexhumed + VegIndex:Aeventexhumed, data=data.to.analyze)) the later inclusive of

[R] aov(HSuccess ~ different VegIndexes)

2012-10-07 Thread Jhope
Hi R-listers, I would like to do an ANOVA with HSuccess ~ each individual Vegetation index (0-5m, 6-10m, 11-15m, 16-20m, 21-25m, 26-30m, 31-35m) and alternatively HSuccess ~ HTLIndex (-5-(-1m), 0-5m, 6-10m, 11-15m, 16-20m, 21-25m, 26-30m). I'm not sure how to write the script for it. I have tri

Re: [R] Reshape2, melt, order of categorical variable and ggplot2

2012-10-07 Thread Jim Holtman
use the 'levels' option on 'factor' to define the explicit order of the factors. This mightbwork on you data: df$V1 <- factor(df$V1, levels = unique(df$V1)) Sent from my iPad On Oct 7, 2012, at 16:40, Stathis Kamperis wrote: > Hello everyone, > > I have the following data frame: > >> df >

Re: [R] Reshape2, melt, order of categorical variable and ggplot2

2012-10-07 Thread David Winsemius
On Oct 7, 2012, at 1:40 PM, Stathis Kamperis wrote: > Hello everyone, > > I have the following data frame: > >> df > V1 V2 V3 > 1 bench1_10 16675 16678 > 2 bench1_10 16585 16672 > 3 bench1_100 183924 185563 > 4 bench1_100 169310 184806 > 5 bench1_300 514430 51