Wang Yi | 2 Dec 06:17

Is there a function or package to perform the trend test considerring autocorrelation in the timeseries

Dear all,

  I dont't understand the output of Mann-Kendall trend test in the R 
package "Kendall". Which value is the indicator of the potential significant trend?

I wonder is there a function or package to perform the trend test considerring 
autocorrelation in the timeseries?

Any suggestion is appreciated in advance!

Regards
--
  Wang Yi
  START Regional Center for Temperate East Asia(TEA),
  Institute of Atmospheric Physics(IAP), 
  Chinese Academy of  Sciences(CAS), 
  Qijiahuozi Huayanli 40#, 
  P.O.Box 9804, Beijing 100029,China 
  Tel:13466795920
  E-mail:wangyi <at> tea.ac.cn

______________________________________________
R-help <at> r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Berwin A Turlach | 2 Dec 06:17
Favicon

Re: r2 for lm() with zero intercept

G'day Glenn,

On Tue, 2 Dec 2008 12:53:44 +1100
<Glenn.Newnham <at> csiro.au> wrote:

> I'm a little confused about the R2 and adjusted R2 values reported by
> lm() when I try to fix an intercept. When using +0 or -1 in the
> formula I have found that the standard error generally increases (as
> I would expect) but the R2 also increases (which seems counter
> intuitive). 

?summary.lm

In particular the part:

r.squared: R^2, the 'fraction of variance explained by the model',

              R^2 = 1 - Sum(R[i]^2) / Sum((y[i]- y*)^2),

          where y* is the mean of y[i] if there is an intercept and
          zero otherwise.

> I do realise that many will say I shouldn't be fixing the intercept
> anyway 

Quite true; accept if there are very good reasons.  I have seen
intercept through the origin being misused to obtain a large R^2 and
significant coefficient when there were none.

Cheers,
(Continue reading)

mauede | 2 Dec 05:05

help with package Rwave

I am looking for some explanations about the usage of the poorely documented R paclkage Rwave.
Has anyone ever tried out its functions for Wavelet Analysis ?

Thank you so much.
Maura

Alice Messenger ;-) chatti anche con gli amici di Windows Live Messenger e tutti i telefonini TIM!
Vai su http://maileservizi.alice.it/alice_messenger/index.html?pmk=footer

	[[alternative HTML version deleted]]

______________________________________________
R-help <at> r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Hamid Hamid | 1 Dec 20:24

vector

Dear All,
I am trying to build a program which will take repeated samples without
replacement from a population of values. The interesting catch is that I
would like the sample values to be removed from the population, after each
sample is taken.

For example:

pop<-c(1,5,14,7,9,12,18,19,65,54)

sample(pop, 2) = lets say, (5,54)
## This is where I would like values (5, 54) to be removed from the
population vector, giving a new "current" population vector:

"new" pop = [1,14,7,9,12,18,19,65]
and has length 8 instead of 10.

In the cases when the size of pop and deriven sample of it is enough large
using the following command is not helpful.
newpop<-pop[-c(2,10)]

One could simplify my question in this way: how we can exclude a sub vector
values from a super  vector value (i.e sub vecor values are subset of super
vector values).
Thanks in advance.
Hamid

	[[alternative HTML version deleted]]

______________________________________________
(Continue reading)

Fernando Miguez | 2 Dec 03:11

Re: [R-sig-Geo] Variables inside a for

Hi Raphael,

If you truly only need to run 4 regressions you might be less confused 
if you just do

test1 <- lm(TX01 ~ INCOME, data = database)
test2 <- lm(TX02 ~ INCOME, data = database)
test3 <- lm(TX03 ~ INCOME, data = database)
test4 <- lm(TX04 ~ INCOME, data = database)

If you need to do this 100 times it is not very practical. Here I'm 
going to assume that your data are in a data frame with the first 100 
columns being dependent variables and column 101 being the independent 
variable. Your first option is to select the component from the lm 
object you are interested in, let's assume the coefficients. Then

n <- 100
mat <- matrix(nrow=n,ncol=2)
for(i in 1:n){
mat[i,] <- lm(data[,i] ~ data[,101])$coef
}

The resulting matrix mat will hold the coefficients of the 100 
regressions. Again, if you really need the whole lm object then you 
could do the following

n <- 100
arr <- array(list(),c(1,n))
for(i in 1:n){
arr[[i]] <- lm(data[,i] ~ data[,101])
(Continue reading)

Jorge Ivan Velez | 2 Dec 04:45

Re: How to solve following equation?

Dear RON70,

Another approach would be Ryacas [1]. Take a look at Section 5.3.2:

> yacas("Newton((1+x)^3-(1+x)^2-(1+x)-1,x,0.1,0.00001)")
expression(0.839286755214161)

Note that this result is _similar_ to Gabor Grothendieck's solution using
optim().

HTH,

Jorge

[1] http://cran.r-project.org/web/packages/Ryacas/index.html

On Mon, Dec 1, 2008 at 9:47 PM, RON70 <ron_michael70 <at> yahoo.com> wrote:

>
> I need to solve a equation like this :
>
> a = b/(1+x) + c/(1+x)^2 + d/(1+x)^3
>
> where a,b,c,d are known constant. Is there any R-way to do that?
>
> Thanks in advance
> --
> View this message in context:
> http://www.nabble.com/How-to-solve-following-equation--tp20785063p20785063.html
> Sent from the R help mailing list archive at Nabble.com.
(Continue reading)

Gabor Grothendieck | 2 Dec 03:58

Re: How to solve following equation?

Assume a = 1.  If not set b = b/a, etc.
Now use (1) uniroot

> f <- function(x) b + c/(1+x) + d/(1+x)^2 - 1 - x
> uniroot(f, 0:1)
$root
[1] 0.8392679

$f.root
[1] 3.049818e-05

$iter
[1] 3

$estim.prec
[1] 6.103516e-05

or multiply through by 1+x
and subtract 1 from both sides giving
x = b + c/(1+x) + d/(1+x)^2 - 1
and iterate that.

> a <- b <- c <- d <- 1
> x <- 0
> for(i in 1:25) {
+ x <- b + c/(1+x) + d/(1+x)^2 - 1
+ print(x)
+ }
[1] 2
[1] 0.4444444
(Continue reading)

hadley wickham | 1 Dec 20:16
Gravatar

Re: How to refer to a list member by variable

On Mon, Dec 1, 2008 at 12:53 PM, Reitsma, Rene - COB
<reitsmar <at> bus.oregonstate.edu> wrote:
> Dear All,
>
> I'm hoping one of you can help me with the following R problem. I'm
> trying to refer to a member of a list by variable. However, this seems
> not to work:
>
> foo=list(first=c(1:10),second=c(11:20))
>
>> foo$first
>  [1]  1  2  3  4  5  6  7  8  9 10
>
>> foo$"first"
>  [1]  1  2  3  4  5  6  7  8  9 10
>
>> goo=c("first")
>
>> foo$goo
> NULL
>
>> foo$goo[1]
> NULL
>

foo[[goo]]

which you'll find in ?"$" under the heading "Recursive (list-like) objects"

Hadley
(Continue reading)

Patrick Aboyoun | 1 Dec 20:10
Favicon

Installation of RCurl Windows binary package from BioC extra repos (was Re: [BioC] Rcurl 0.8-1 update for bioconductor 2.7)

Hi Roger,
Good to hear from you again. Given that RCurl is hosted in both the CRAN 
mirrors and in the Bioconductor extra repository, it can be a little 
confusing how to install it on your system. The recommended path is to 
follow the steps on the Bioconductor extra home page for RCurl

http://bioconductor.org/packages/release/extra/html/RCurl.html

To install this package, start R and enter:

    source("http://bioconductor.org/biocLite.R")
    biocLite("RCurl")

Patrick

Day, Roger S wrote:
> Hi Patrick,
>
> 	Greetings from !(sunny) Pittsburgh.
>
> 	What's the scoop on RCurl on windows (XP)?
> I've tried to install RCurl_0.92-0.zip and RCurl_0.9-3.zip,
> with both R 2.7.2 and R 2.8.0 from the RGUI (utils:::menuInstallLocal),
> and get the error
> 	"Windows binary packages in zipfiles are not supported".
> which (according to google's one and only hit) comes from a perl script.
> Your suggestion (below) to use biocLite hangs the R session, at this point:
> 	Running biocinstall version 2.3.9 with R version 2.8.0 
> 	Your version of R requires version 2.3 of Bioconductor.
> 	trying URL 'http://bioconductor.org/packages/2.3/extra/src/contrib/RCurl_0.92-0.tar.gz'
(Continue reading)

Greg Snow | 1 Dec 19:31

Re: Randomization of a two-way ANOVA?

This really depends on the question(s) that you are asking.

If you want a simultaneous test of all your factors, then you can randomly permute the response many times
and see where the original f-stat (or others) falls in the distribution of the randomized stats.

If you want to test the interaction, then fit the full model and save the f-stat for the interaction term.  Fit
the model without the interaction and save the residuals and fitted values, permute the residuals and add
them back to the fitted values, then analyze this with the full model and save the f-stat.  Repeate and see
how the f-stat (or other stat) of the original fit compares to the permuted stats.

For combinations of other questions, just do the same as above but with the full and reduced model that
matches the question(s) of interest.

You could also do bootstrapping as a randomization test, there are a couple of packages that help with that
(but it is also easy without the packages), but for testing, I prefer the permutation test.

Hope this helps,

--
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.snow <at> imail.org
801.408.8111

> -----Original Message-----
> From: r-help-bounces <at> r-project.org [mailto:r-help-bounces <at> r-
> project.org] On Behalf Of Joe Ratster
> Sent: Sunday, November 30, 2008 1:22 PM
> To: r-help <at> r-project.org
(Continue reading)

ravi | 1 Dec 19:29

Help with lattice graphics

Hi,
I like the formatting and the appearance of lattice plots. But I have not succeeded in gettting the right
format in my plots with the lattice package in one of my applications. In the code shown below, I start by
constructing a general data frame and show my attempts with the lattice package commands. After that, I
use the graphics package and show the kind of plot that I want to get.

I would like to know how the lattice commands can be modified to get the final plot that I have obtained with
the graphics package. Any explanatory comments to understand better the modifications are most welcome.

Here is my code :
##########################################################
rm(list=ls())
# make up a test data frame with 4 columns
# factors in first 3 cols and a numeric in the 4th
vec_a<-paste("A",1:4,sep=(''));na<-length(vec_a)
vec_b<-paste("B",1:5,sep=(''));nb<-length(vec_b)
yr<-c("2007","2008","2009");ny<-length(yr)
fac_a<-factor(vec_a);fac_b<-factor(vec_b);fac_yr<-factor(yr)
n<-na*nb*ny
# y is the response variable
y<-runif(n);y<-round(y,digits=1)
dfa<-rep(fac_a,times=nb*ny)
dfb<-rep(fac_b,each=na,times=ny)
dfyr<-rep(fac_yr,each=na*nb)
dataf<-data.frame(dfa=dfa,dfb=dfb,dfyr=dfyr,y=y);head(dataf)
# dataf is the test data frame
# First test with the lattice package
library(lattice)
barchart(y~dfb|dfyr,dataf,layout=c(3,1),beside=FALSE,
          groups=dfa,
(Continue reading)


Gmane