Highland Statistics Ltd | 26 May 00:52 2015

Stats course Phillip Island Nature Parks, Australia

Apologies for cross-posting

We would like to announce the following statistics course:

Course: Data exploration, regression, GLM & GAM with introduction to R
When: 14 - 18 September 2015
Where: Phillip Island Nature Parks, Australia
Course flyer: 
http://www.highstat.com/Courses/Flyers/Flyer2015_09PhillipIsland_regression_GLM_GAM.pdf
URL: http://www.highstat.com/statscourse.htm

Kind regards,

Alain Zuur

--

-- 
Dr. Alain F. Zuur

First author of:
1. Beginner's Guide to GAMM with R (2014).
2. Beginner's Guide to GLM and GLMM with R (2013).
3. Beginner's Guide to GAM with R (2012).
4. Zero Inflated Models and GLMM with R (2012).
5. A Beginner's Guide to R (2009).
6. Mixed effects models and extensions in ecology with R (2009).
7. Analysing Ecological Data (2007).

Highland Statistics Ltd.
9 St Clair Wynd
UK - AB41 6DZ Newburgh
(Continue reading)

andrejfavia | 25 May 22:39 2015
Picon

How do I move the horizontal axis in a plot so that it starts at the zero of the vertical axis?

Greetings.

[1] How do I move the horizontal axis in a plot so that it starts at the
zero of the vertical axis? I tried using ylim=c(0, 2) but it doesn't
work. I'd also like to keep the "0.0" along the vertical axis and not
have it vanish.

[2] Also, how do I change the data points to five-pointed stars?

[3] Also, how do I know where threads posted to this email address
appear on the Nabble forum, so that I can post to it and have my posts
approved?

Example:

x <- c(-2.5, -1.3, 0.6, 0.8, 2.1)
y <- c(0.3, 1.9, 1.4, 0.7, 1.1)

plot(x, y, ylim=c(0, 2))

gavinr | 25 May 21:28 2015
Picon
Picon

run a calculation function over time fields, ordered and grouped by variables

I’ve got some transit data relating to bus stops for a GIS data set.  Each
row represents one stop on a route.  For each record I have the start time
of the route, a sequence in which a bus stops, the time the bus arrives at
the first stop and the time taken to get to each of the stops from the last
one in the sequence.  Not all sequences of stops starts with the number 1,
some may start with a higher number.
I need to make a new variable which has the time the bus arrives at each
stop by using the start time from the stop with the lowest sequence number,
to populate all of the arrival times for each stop in each route. 

I have a very simple example below with just three routes and a few stops in
each.  My actual data set has a few million rows.  I've also created a
version of the data set I'm aiming to get.

There are two problems here.  Firstly getting the data into the correct
format to do the calculations with 
durations, and secondly running a function over the data set to obtain the
times.
It is the durations that are critical not the date, so using the POSIX
methods doesn’t really seem appropriate here.  Ultimately the times are
going to be used in a route solver in an ArcSDE geodatabase.  I tried to use
strptime to format my times, but could not get them into a data.frame as
presumably they are a list.  In this example I’ve left them as strings. 

Any help is much appreciated.

#create four columns with route id, stop sequence interval time and route
start time
ssq<-c(3,4,5,6,7,8,9,1,2,3,4,2,3,4,5,6,7,8)
tint<-c("00:00","00:12","00:03","00:06","00:09","00:02","00:04","00:00","00:08","00:10","00:10","00:00","00:02","00:04","00:08","00:02","00:01","00:01")
(Continue reading)

Miller Andres Ruiz Sanchez | 25 May 17:56 2015

Trouble with SPI package

Hello,

I write to ask you about an error that I have when I use the script below.
I'm working with monthly  precipitation  data for the period between 1990
and 1998.

I really thanks your help.

_______________________________________________________________

> require(SPEI)
> require(spi)
> require(sm)

> dir()
[1] "IndexScript.R"  "PradoCorre.txt" "spi.txt"

> Prado=read.table("PradoCorre.txt", head=TRUE, dec=".")

> write.table(Prado,file="PradoCorre.txt",quote=FALSE,row.names=TRUE)

> spi(3,"PradoCorre.txt",1990,1998)
Error en data[i, ] : subíndice fuera de  los límites

> Prado
   Months X1990  X1991 X1992 X1993 X1994 X1995 X1996 X1997 X1998
1     Jan   0.0   0.00   0.0  22.3   0.0   0.0  15.4   0.0   0.0
2     Feb   0.0  11.00   0.0   0.0   0.0   0.0   0.0   2.5   0.0
3     Mar   0.0   8.70   0.0  13.1   0.3   0.4  34.3   0.0   3.8
4     Apr  52.0  32.20  96.8  70.0  61.4 251.0  21.0  31.0  18.0
(Continue reading)

John Kane | 25 May 17:31 2015

Re: Vincentizing Reaction Time data in R


Thanks Gabriel, 
That new method you found looks interesting even if it is a long way from anything I am likely to be doing.

Re my code below.  It looks like  vincentization is actually straight-forward.  I used bins = 10 since it was a
convenient number.  I imagine if one was to actually turn this into a function it would not be that hard to
come up with some formula to calculate bin size although statisticians may be wincing when they read that
last remark.

I played a little more with the idea and it really looks pretty easy to  vincentizatise a data.frame.  

John Kane
Kingston ON Canada

> -----Original Message-----
> From: gabriel.weindel <at> gmail.com
> Sent: Mon, 25 May 2015 11:55:04 +0200
> To: jrkrideau <at> inbox.com
> Subject: Re: [R] Vincentizing Reaction Time data in R
> 
> Hi John,
> 
> Sorry for the response delay.
> 
> I found a way to do it in a slight different way :
> http://www.nicebread.de/comparing-all-quantiles-of-two-distributions-simultaneously/
> 
> You're right with the application. I just put some comments in your post.
> 
> Thank you for your time. I will now use the quantile comparison for my
(Continue reading)

Glenn Schultz | 25 May 15:04 2015

data for pass though OAS viewport question

Attached is dput of the pass through OAS 
______________________________________________
R-help <at> r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Shivi82 | 25 May 14:19 2015

Issues with loading csv file

HI All,

I am trying to load an CSV file into the R project. the code for the same
is:
mydata<- read.csv("Jan-May Data.csv", header=TRUE)

however with this I am getting the below error message:
/*Error in file(file, "rt") : cannot open the connection
In addition: Warning message:
In file(file, "rt") :
  cannot open file 'Jan-May Data.csv': No such file or directory*/

I am under the impression that R automatically pulls the data from the
working directory and we do not have to add the location where the file is
saved. Please let me know if my understanding is correct and help on the
error as well.

Please note the csv file is already saved in the WD.
Thank you, Shivi

--
View this message in context: http://r.789695.n4.nabble.com/Issues-with-loading-csv-file-tp4707637.html
Sent from the R help mailing list archive at Nabble.com.

wsq@szu.edu.cn | 25 May 04:25 2015
Picon

How to extract the standardized residuals tests from the summary report of fGarch

I am using the Rmarkdown to produce a  html slides automatically, and I want to known
How to extract the standardized residuals tests section from the summary report?


Here are the R-code:


>library("fGarch") 
>N = 200
>x.vec = as.vector(garchSim(garchSpec(rseed = 1985), n = N)[,1])
>fit=garchFit(~ garch(1,1), data = x.vec, trace = FALSE)


> summary(fit)


Title:
 GARCH Modelling 


Call:
 garchFit(formula = ~garch(1, 1), data = x.vec, trace = FALSE) 


Mean and Variance Equation:
 data ~ garch(1, 1)
<environment: 0x000000002df6b330>
 [data = x.vec]


(Continue reading)

Ivone Figueiredo | 25 May 09:02 2015
Picon

Problem on estimating fish species

Hi
I am trying to estimate the proportion of species landed by species. But I
always get error messages.

Can you please help me? Thanks Ivone

 I am trying to use R2Winbugs to

skate.4 <- bugs (skateA.data, inits=skatesA.inits, skateA.parameters,
model1.file,   n.chains=1, n.iter=50,          bugs.directory="C:/Program
Files (x86)/OpenBUGS/OpenBUGS323/", program=c("OpenBUGS"), debug=TRUE)

skateA.data <- list(n=length(y_A), y_A =y_A, Species_A= Species_A,
n.species_A=n.species_A)

skateA.parameters <- c ("mu","b.species", "sigma.species",  "sigma.epsilon")

skatesA.inits <- function (){
  list (mu=rnorm(0.5),  b.species=rnorm(0.2), sigma.species=runif(1),
        sigma.epsilon=runif(1))}

The model is

model {
  for (i in 1:n){
    y[i] ~ dpois (lambda[i])
    lambda[i] <- exp(mu+b.species[Species_A[i]] + epsilon[i])
    epsilon[i]  ~ dnorm (0, tau.epsilon)
  }
  mu ~ dnorm (0, .0001)
(Continue reading)

Glenn Schultz | 25 May 03:27 2015

Viewport help

Hello All,

I have a function which outputs graphically the results of a pass-through OAS analysis.  The viewport is
2x2.  The idea is to leave a small margin at the top and enter a title with something like the following. 

Bond Lab Pass Through OAS 
Bond Id: foo <at> bond.id
OAS : foo <at> OAS

I am a little lost on the viewport and can't quite get to the last step.  The function is below and the code I
have question about is in red.

Glenn

The function is below - The code I have a question about is in red
#' OAS Analaysis of Pass Though MBS
#' 
#' Function calls BondLab PassThroughOAS and plots the results
#' copyright Bond Lab Technologies, Inc 2015
#'  <at> importFrom BondLab PassThroughOAS
#'  <at> param bond.id a character string the bond id
#'  <at> param trade.date a character string the trade date
#'  <at> param settlement.date a character string the settlement date
#'  <at> param original.balance a numeric value the original balance
#'  <at> param price a numeric value the price
#'  <at> param sigma a numeric the **annualized** volatility.  The volatilty assumption assumes
#' a trading year of 252 days
#'  <at> export
PassThrough.OAS <- function(bond.id = character,
                            trade.date = character,
(Continue reading)

Curtis Burkhalter | 24 May 23:34 2015
Picon

problem with duplicated function

Hello everyone,

I have two very large dataframes (~1 million rows x 5 columns), of which
two of the columns are lat/long coordinates. The names of the dataframes
are 'data07' and 'data 08'. Data08 has a few more sampling points than data
07 so I want to subset data08 so that it has the same number of data points
as data07 using the unique lat/long coordinates.

Here are the associated data structures:

*str(data07)*
'data.frame':   969109 obs. of  5 variables:
 $ cell    : int  710228 715545 720690 720824 695611 700490 700626 705371
705507 710363 ...
 $ prN     : int  288 276 286 304 258 257 264 272 286 316 ...
 $ Location: Factor w/ 32 levels " ","Blacks_Fork",..: 24 24 24 24 24 24 24
24 24 24 ...
 $ Xcor    : num  -111 -111 -111 -111 -111 ...
 $ Ycor    : num  41.7 41.7 41.7 41.7 41.8 ...

*str(data08)*
'data.frame':   969810 obs. of  5 variables:
 $ cell    : int  705528 710321 710456 715677 720762 720896 699953 700635
700771 705664 ...
 $ prN     : int  293 281 299 278 276 266 282 255 287 280 ...
 $ Location: Factor w/ 31 levels "Blacks_Fork",..: 23 23 23 23 23 23 23 23
23 23 ...
 $ Xcor    : num  -111 -111 -111 -111 -111 ...
 $ Ycor    : num  41.8 41.7 41.7 41.7 41.7 ...

(Continue reading)


Gmane