[R] Dispersion Index in POT

2017-08-11 Thread FMH via R-help
Dear All,
I would like to plot the dispersion index against lambda and dispersion index 
against threshold.

Appreciate if someone could help me to extract dispersion index in POT package. 
Pls also let me know the way to calculate it manually for a skewed distribution.
Thank you

[[alternative HTML version deleted]]

__
R-help@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.


[R] Continuous Wavelet tranform in Biwavelet Package

2016-11-04 Thread FMH via R-help
Dear All,
I have 15 minutes of temperature data for 3 years and would like calculate and 
plot the CWT using wt command in Biwavelet package. 

Appreciate if someone could tell me the way to define it in wt command.
Thank you,
[[alternative HTML version deleted]]

__
R-help@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.


[R] R2 for a mixed-effects model with AR(1) error structure

2011-11-17 Thread FMH


Dear All,

The following equation is a linear mixed-effects  model with linear trend and 
AR(1) error structure,

y = B0 + B1x + bo + b1x + e; e~AR(1) 

where  y is a response, x is the predictor, B0 and B1 are fixed effects and b0 
and b1 are random effects. 

Coud someone please advice me a function to compute the R2 for the goodness of 
fit of the above model in R package, and  are the computation for R2 in the 
mixed model with AR(1) error structure similar to the mixed model with no error 
structure?

thanks,
Fir
[[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] goodness of fit of a mixed model and function in R

2011-11-16 Thread FMH
Dear All,
 
Could anybody please advice me the way to check the goodness of fit of the 
linear mixed-effects model and the suitable function in R to do so, and thank 
you in advance for your assistance.
 
Fir
[[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] Extremum index from a sampling time series data

2011-07-08 Thread FMH
Dear All,
 
I am working on a time series of hourly river flow measurements from 2000 - 
2003  and have been trying to compute the extremum index from the original 
series as well as a new series from  sampling with replacement . The extremum 
Index produced from the original data series looks  fine but sadly, a strange 
value of index is given from the sampling. The flow measurements are in range 
of 0.1 to 35m3/s and are stored in data frame with the codes and  results are 
as follows:
 
##
 
### Codes   ###
attach(data)
 
# Estimates of extremum index 
 
library(evd)
library(boot)
set.seed(101)
 
threshold - 15

ej - exi(data$flow, u=threshold)   # 
Extremum Index computed from the original series of river flow
ei - exi(sample(data$flow, replace=T), u=threshold) # Extremum Index 
computed from sampling of the original flow series with replacement
ei; ej
mean(ei); mean(ej)
 
###
 
 Results 
ei = 0.4
ej = 1
mean(ei) = 1.023
mean(ej) = 1.014
 
###
 
I would  expect that the results for both index should be slightly similar as 
the features of both original  sampling series are more or less the same as 
highlighted by their sample mean and so, could  anybody please advice me on 
this matter?
 
Thank you,
Fir
[[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] cluster analysis on extreme event

2011-05-27 Thread FMH
Dear all,

I'm  modelling  extreme rainfall,particularly those that lie above a threshold 
  was searching for a suitable package in R which may enable a cluster 
analysis on those extreme events and would really appreciate for any 
suggestions.

Thanks,
Fir

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/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] best subset regression in R

2011-05-04 Thread FMH
Dear All,
 
Could someone please give some advice the way to do linear modelling via best 
subset regression in R? I'd really appreciate for your kindness.
 
Thanks,
Kagba
[[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] Box-Cox transformation in R

2011-05-04 Thread FMH
Hi,
 
Could any one please help how I can transform data based on Box-Cox 
Transformations in R. 
 
Any helps will be much appreciated. 
 
thanks,
Kagba
[[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] How to find points of intersection

2011-02-22 Thread FMH
Dear All,

I'm looking an appropriate way in R to compute/estimate  points of intersection 
between a line and a curve and will really appreciate for any suggestion or 
ideas?

Thank you,
Fir




__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/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 find points of intersection between harmonic function and a line

2011-02-22 Thread FMH
Hi,

Sorry for the very short explanation about the problem of intersection. 

I have a wave function monitored from the heart beat in a particular interval 
of 
times. Apart fom that, there is a line with positive slope (e.g: y = x+2) which 
lies across the wave and intersect on a number of points. My problem is i have 
no exact equation for such a complex harmonic wave produced by the heart pulse 
and so, cannot manage to find the intersection points. 


Therefore, i would be very grateful if someone could give some ideas or might 
suggest any packages in  R that can assist me to do so.

Thank you,
Fir



- Original Message 
From: Uwe Ligges lig...@statistik.tu-dortmund.de
To: FMH kagba2...@yahoo.com
Cc: r-help@r-project.org
Sent: Tue, February 22, 2011 1:11:41 PM
Subject: Re: [R] How to find points of intersection



On 22.02.2011 12:27, FMH wrote:
 Dear All,

 I'm looking an appropriate way in R to compute/estimate  points of 
intersection
 between a line and a curve and will really appreciate for any suggestion or
 ideas?

Sounds like second level school homework. If not, please explain your 
problem in more detail and

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


Uwe Ligges



 Thank you,
 Fir




 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/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 to find points of intersection between harmonic function and a line

2011-02-22 Thread FMH
Hi,

Sorry for the very short explanation about the problem of intersection. 

I have a wave pattern monitored from the heart beat in a particular interval of 

times. Apart fom that, there is a line with positive slope (e.g: y = x+2) which 
lies across the wave and intersect on a number of points. My problem is i have 
no exact equation for such a complex harmonic wave produced by the heart pulse 
and so, cannot manage to find the intersection points. 


Therefore, i would be very grateful if someone could give some ideas or might 
suggest any packages in  R that can assist me to do so.

Thank you,
Fir



__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/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 find points of intersection between harmonic function and a line

2011-02-22 Thread FMH
Hi,

Sorry for the very short explanation about the problem of intersection. 

I have a wave function monitored from the heart beat in a particular interval 
of 

times. Apart fom that, there is a line with positive slope (e.g: y = x+2) which 
lies across the wave and intersect on a number of points. My problem is i have 
no exact equation for such a complex harmonic wave produced by the heart pulse 
and so, cannot manage to find the intersection points. 


Therefore, i would be very grateful if someone could give some ideas or might 
suggest any packages in  R that can assist me to do so.

Thank you,
Fir




__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/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] Optimal choice of the threshold u in Peak Over Threshold (POT) Approach

2011-02-10 Thread FMH
Dear All,

Could someone please suggest me the way to calculate the optimal threshold in 
POT method via any available  packages in R?

Thanks,
Fir




__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/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] NA with lmList

2010-10-13 Thread FMH
Dear All,
  
I was trying to use the lmList function to get the lmList graphic but  have a 
problem creating the graphic.  My data has missing values and an error 
occurred  
as stated below. 



###

library(nlme)

 a 
  schoolid spring score childid 
1 1 0 550 345 
2 1 1 568 345 
3 1 0 560 456 
4 1 1 NA 456 
5 2 0 540 32 
6 2 1 562 32 
7 2 0 579 34 
8 2 1 599 34 


(lmlis1 - lmList(score ~ childid | spring, data=a, na.action=T))

Error in UseMethod(getGroups) : no applicable method for getGroups

###


Could anybody advice me the way to write the command correctly, which ignore 
the 
missing data?

Cheers
Fir


   
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/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 change font size in plot() function

2010-09-08 Thread FMH
Dear All,

Could someone please advice me the way to change the size of the title and x 
and 
y-label in plot() function. I've tried to use 'font' and 'font.main' call in 
plot() function, but it didn't make any changes in terms of the size.

Thanks
Fir

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/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] Kalman filter

2010-08-13 Thread FMH
Dear All,

Could anyone give me a hand to suggest few packages in R to running Kalman 
prediction and filtration ?

Thanks
Fir




__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/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] SARIMA model

2010-07-13 Thread FMH
Dear All,

Could someone please advice me the appropriate package for fitting the SARIMA 
model? 


Thanks
Fir




__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/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] smoothing parameter in locfit package

2010-05-10 Thread FMH
Hi, 

In the locfit package, could someone please let me know the automatic selection 
of smoothing parameter if Gauss kernel density function is used as weight 
function?

thanks
Fir


  
[[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] smoothing parameter in locfit package

2010-05-10 Thread FMH
Thank you Andy. I'm aware of that but my question is about the way  the locfit 
package use to automatically determine the bandwidth/smoothing parameter if 
Gauss kernel density function is used as the weight function. Does the 
generalized cross validation criteria is imposed here or does the value of the 
bandwidth is fixed (by default) in the package, unless we specify our own value?


Cheers,
Fir



- Original Message 
From: Liaw, Andy andy_l...@merck.com
To: FMH kagba2...@yahoo.com; r-help@r-project.org
Sent: Mon, May 10, 2010 4:00:51 PM
Subject: RE: [R] smoothing parameter in locfit package

See the kern argument in ?locfit.raw.

Andy 

From: FMH
 Hi, 
 
 In the locfit package, could someone please let me know the 
 automatic selection of smoothing parameter if Gauss kernel 
 density function is used as weight function?
 
 thanks
 Fir
 
 
      
     [[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.
 
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 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.




__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/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] Third and fourth order of derivative in smooth.lf function from locfit package

2010-04-14 Thread FMH
Dear All,

Could someone please advice me the way to define the derivative of the local 
polynomial regression in third and fourth order from the smooth.lf function?

Thank you
Fir


  
[[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] Derivative of a smooth function

2010-04-02 Thread FMH

Dear All,

I've been searching for appropriate codes to compute the rate of change and the 
curvature of  nonparametric regression model whish was denoted by a smooth 
function but unfortunately don't manage to do it. I presume that such 
characteristics from a smooth curve can be determined by the first and second 
derivative operators.

The following are the example of fitting a nonparametric regression model via 
smoothing spline function from the Help file in R.

###
attach(cars)
plot(speed, dist, main = data(cars)    smoothing splines)
cars.spl - smooth.spline(speed, dist)
lines(cars.spl, col = blue)
lines(smooth.spline(speed, dist, df=10), lty=2, col = red)
legend(5,120,c(paste(default [C.V.] = df =,round(cars.spl$df,1)),s( * , df 
= 10)), col = c(blue,red), lty = 1:2, bg='bisque')
detach()

###


Could someone please advice me the appropriate way to determine such 
derivatives on the curves which were fitted by the function above and would 
like to thank you in advance.

Cheers
Fir 





__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/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] Inflection point on a curve

2010-03-30 Thread FMH
Dear All,

I have been trying to find an inflection point from a nonparametric model, for 
instance on  a series of Economics, Financial, Environmental data, which was 
fitted via sm.regression package, but have difficulty to find the derivative of 
the model. The following are the data and the codes to fit such a nonparametric 
model.

###
library(sm)
x - c(6.3,  6.6,  7.0,  8.0,  8.8,  9.8, 12.0, 14.2, 15.5, 15.7, 15.8) 
y - rev(seq(1,51,by=5))
sm.regression(x,y,method = cv, col = red)
###


Could someone please advice me an appropriate way to determine such an 
inflection point from the nonparametric model?

Thank you
Fir 





__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/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] Changepoints estimation in a data series

2010-03-01 Thread FMH
Dear All,

I'm trying to find changepoints in a data series  which only consist of  11 
measurements of altitude(x) and temperature(y), respectively, in which the data 
are as followed:

y = 16.3, 16.2, 16.1, 15.6, 14.2, 10, 8.2,  8.0, 7.5, 7.3, 7.2
x = 1,  2,  5, 10, 15, 20, 25, 30, 40, 50, 60

From the above series, i reckon there is more than one changepoint and  
presuming there is a package in R which might enable the estimation on such 
changepoints.

Could someone please advice me on this matter by using R?

Cheers,
FMH




__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/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 extract one of four plots in a linear regression model

2010-02-25 Thread FMH
Dear All,

A linear regression model could be fitted by using lm function and the plot 
function can be used to check the assumption of the model. 

The help menu shows few instances on suitable coding for fitting such a linear 
model. In addition, four different plots could be extracted simultaneously with 
only a single plot function as followed:



require(graphics)
## Annette Dobson (1990) An Introduction to Generalized Linear Models.
## Page 9: Plant Weight Data.
ctl - c(4.17,5.58,5.18,6.11,4.50,4.61,5.17,4.53,5.33,5.14)
trt - c(4.81,4.17,4.41,3.59,5.87,3.83,6.03,4.89,4.32,4.69)
group - gl(2,10,20, labels=c(Ctl,Trt))
weight - c(ctl, trt)
anova(lm.D9 - lm(weight ~ group))
opar - par(mfrow = c(2,2), oma = c(0, 0, 1.1, 0))
plot(lm.D9, las = 1) 




The plot function gives four different plots simulaneously but i just need only 
part of them, for instance the normality plot. Could someone  give some ideas 
the way to extract this single plot as i need to copy only this plot and paste 
it into Word document.

Thanks
Fir





__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/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 add a title to represent four different plot in lm function

2010-02-25 Thread FMH
Dear All,

A linear regression model could be fitted by using lm function and the plot 
function can be used to check the assumptions of the model. The example is as 
followed.

require(graphics)
## Annette Dobson (1990) An Introduction to Generalized Linear Models.
## Page 9: Plant Weight Data.
ctl - c(4.17,5.58,5.18,6.11,4.50,4.61,5.17,4.53,5.33,5.14)
trt - c(4.81,4.17,4.41,3.59,5.87,3.83,6.03,4.89,4.32,4.69)
group - gl(2,10,20, labels=c(Ctl,Trt))
weight - c(ctl, trt)
anova(lm.D9 - lm(weight ~ group))
opar - par(mfrow = c(2,2), oma = c(0, 0, 1.1, 0))
plot(lm.D9, las = 1) 

Could someone advice me the way to add a single title either at the above or 
bottom of these 4 plots, entitled The verification of model assumtion via four 
different plots ?

Thanks
Fir




__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/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] Color intervals in image function (image.plot)

2010-02-08 Thread FMH
Hi,

The script below is my current coding in order to produce a contour plot of 
temperature across altitude and time. In my case, time,altitude and 
temperature are represented by x, y and z variables.


##
Brazilan.Pallete - colorRampPalette(c(blue,green,yellow,red))
image.plot(x, y, z, col = Brazilan.Pallete(50))
contour(x,y,z, levels = seq(1, 20, by = 1), add = TRUE, col = 'peru')
##



The plot worked fine but i found difficult to fix the interval of the color 
corresponding to z value. In my case, the range of z values is between 1 and 40 
and  i'd like to fix the color in the image correspoding to four sub-intervals 
of z values. For instance:

1. 1  z  10 : blue
2. 11  z  20: green
3. 21  z  30: yellow
4. 31  z  40 : red.

I did't find a suitable coding to do this. Could someone please give an advice 
on this matter?

Thank you.
Fir





__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/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] Color intervals in image.plot function

2010-02-08 Thread FMH

Hi,

The script below is my current coding in order to produce a contour plot of 
temperature across altitude and time. In my case, time,altitude and 
temperature are represented by x, y and z variables.


##
Brazilan.Pallete - colorRampPalette(c(blue,green,yellow,red))
image.plot(x, y, z, col = Brazilan.Pallete(50))
contour(x,y,z, levels = seq(1, 40, by = 1), add = TRUE, col = 'peru')
##



The plot worked fine but i found difficult to fix the interval of the color 
corresponding to z value. In my case, the range of z values is between 1 and 40 
and  i'd like to fix the color in the image correspoding to four sub-intervals 
of z values. For instance:

1. 1  z  10 : blue
2. 11  z  20: green
3. 21  z  30: yellow
4. 31  z  40 : red.

I did't find a suitable code to do this. Could someone please give an advice on 
this matter?

Thank you.
Fir




__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/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 seperate date and time into different columns?

2010-01-22 Thread FMH
Dear All,

I have a series of data in which the first column consist of a combination of 
date and time, for instance 17 April 2008 at 4.01pm, such data is recorded as:

4/17/2008 16:01 

I'd like to seperate it into four different columns which consist of Day, 
Month,Year and Time, respectively.

Could someone please advice me on this mater?

Thank you,
Fir

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/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] Interception point between two lines

2010-01-05 Thread FMH
Dear All,

Let mod2 and mod3 are two regression equations representing two distinct lines 
and i'm keen to find the intreception point between these two lines 
and the following are part of the codes.

 
     m1 - as.matrix(rbind(coef(mod2), coef(mod3)))
 a - cbind(c(1,1), -m1[, 2])
 b - m1[,1]
     c - solve(a=a,b=b)

 Unfortunately, there is an error message given as stated below and i don't 
understand what it meants for.


' Error in drop(.Call(La_dgesv, a, as.matrix(b), tol, PACKAGE = base)) : 
system is computationally singular: reciprocal condition number = 1.14557e-16'


Could anybody advice me on this matter?

Thank you
Fir




__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/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] Inverse matrix

2009-12-28 Thread FMH
Dear All,

Let A is a matrix which is:
A - matrix(c(1,2,3,4),nrow=2) 

How could we find the inverse of A? I try to use ginv(A), but it didn't worked.

Thanks

Fir

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


[R] A comparison between span in lowess method and h in sm.regression

2009-11-12 Thread FMH
Dear All,

I have fitted a bivariate and an additive model on a monthly temperature from 
1987-2007 via nonparametric regression and would like to compare between these 
models via F-test, but having difficulty in determining the possible values of 
span with lowess method.

For instance, these two models are defined in R as: 

##
bivariate.model - sm.regression(c(month,year), Temperature, h = c(0.2,0.8)) 
additive.model - gam(Temperature~lo(month, span=A) + lo(year,span=B)) 
##

However, i notice the sm.regression function uses h as a smoothing parameter  
whilst the gam function uses span as a smoothing parameter, and these models 
can't just simply be compared straight  forward, but few adjustments should be 
made on the values of span in gam function, corresponding to the values of h in 
sm.regression function. 

Could anyone please advice me  the possible values of A and B in the gam 
function above? I'd would be very grateful for any idea and suggestion towards 
this issue.

Thank you
Fir




__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/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-SIG-Finance] Additive decomposition method

2009-11-03 Thread FMH
Hi, 

Thank you for the function.

I was trying to use the decompose function, but the program cannot run as 
there were several missing values in my data frame. 

Could someone advice me the way to handle on this matter?

Thanks

F





__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/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] tapply function

2009-11-03 Thread FMH
Hi,

I tried to use tapply function to find the mean of the data in each group as 
the following command, but the result are NA, as there are several missing 
values in each group.

tapply(data,group,mean)

Could someone please advice me the way to  ignore the missing data in order for 
the fucntion to run successfully?

Thanks

Fir




__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/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] Additive decomposition method

2009-11-02 Thread FMH
Dear All,

I'm doing an  imputation on few missing data and is looking for an additive 
decomposition method in R. Could someone please advice me the way to do this?

Thank you
Fir




__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/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] Decomposition method

2009-11-01 Thread FMH
Dear All,

I'm doing an  imputation on the missing data and is looking for a decomposition 
method in R. Could somone advice me the way to do this?

Thank you
Fir




__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/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 find the interception point of two linear fitted model in R?

2009-10-21 Thread FMH
Dear All,

Let have 10 pair of observations, as shown below.

##
x - 1:10
y - c(1,3,2,4,5,10,13,15,19,22)
plot(x,y)
##


Two fitted  models, with ranges of [1,5] and [5,10], can be easily fitted 
separately by lm function as shown below:

###
mod1 - lm(y[1:5] ~ x[1:5])
mod2 - lm(y[5:10] ~ x[5:10])
###

I'm looking for the interception points between these two straight lines from 
these fitted models, mod1 and mod2. 

Could someone advice me the way to do it?

Thank you
Fir 




__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/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] Estimation in a changepoint regression with R

2009-10-15 Thread FMH
Dear All,

I'm trying to do the estimation in a changepoint regression problem via R, but 
never found any suitable function which might help me to do this. 

Could someone give me a hand on this matter?

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.


[R] Slope between two points

2009-10-08 Thread FMH
Dear All,

Let  499 piece-wise lines were buit up by 500 pair of observations, via R code 
below.

x - 1:500
y - rnorm(500)
plot(x, y, type = 'b')

I was trying to compute all the slopes for the  lines which were connected 
between two adjacent points. For instance, slopes of lines between first and 
second points, second and third points, and so on, until between  points 499 
and 500, respectively, but sadly, i never found a suitable function do this 
computatation efficiently.

Could someone please advice me on doing this?

Thank you
Fir



__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/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 use multiple time series in R?

2009-10-08 Thread FMH
Dear All,

I have temperature series for 10 different sea levels, where there are 3000 
observations for each level. I am planning to use multiple time 
series modelling on these series, with/ without correlation structure for the 
residuals.

Is there any package that can be used to do this operation, and i really 
appreciate for any suggestion/advice on this matter.

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.


[R] How to speed up R with version 2.9.2?

2009-10-02 Thread FMH
Dear All,

I'm sorry if my question does not suit with this R group.

I have recently installed R software with version 2.9.2, but i found the 
program took almost 1 minute as soon as it was opened, before it can be used. 
However, the previous version 2.9.1 only take few seconds after the menu bar 
was clicked. This circumstance has caused me to wait for couple of minutes as 
several R windows were opened simultaneously.

Are there any ways to speed up on this 2.9.2 version? Could someone give some 
hints, please?

Thank you
Fir




__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/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 speed up R with version 2.9.2?

2009-10-02 Thread FMH
Thank you for your answer. I'm using Win XP with 2GB RAM in memory.

Cheers
Fir



- Original Message 
From: stephen sefick ssef...@gmail.com
To: FMH kagba2...@yahoo.com
Cc: r-help@r-project.org
Sent: Fri, October 2, 2009 4:38:10 PM
Subject: Re: [R] How to speed up R with version 2.9.2?

You're fine, but please do read the posting guide.  What OS etc.
Where you doing anything else on the computer?  Is this a RAM
limitation?  I have 2.9.2 running on two flavours of linux, mac os x
and windows all 2.9.2 and there doesn't seem to be a problem.
regards,

Stephen

On Fri, Oct 2, 2009 at 10:35 AM, FMH kagba2...@yahoo.com wrote:
 Dear All,

 I'm sorry if my question does not suit with this R group.

 I have recently installed R software with version 2.9.2, but i found the 
 program took almost 1 minute as soon as it was opened, before it can be used. 
 However, the previous version 2.9.1 only take few seconds after the menu bar 
 was clicked. This circumstance has caused me to wait for couple of minutes as 
 several R windows were opened simultaneously.

 Are there any ways to speed up on this 2.9.2 version? Could someone give some 
 hints, please?

 Thank you
 Fir




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




-- 
Stephen Sefick

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

                                -K. Mullis





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


Re: [R] How to speed up R with version 2.9.2?

2009-10-02 Thread FMH
Yes, i noticed there are few Windows start up programs, shown by the 
EasyCleaner software.

Cheers

 


- Original Message 
From: Gabor Grothendieck ggrothendi...@gmail.com
To: FMH kagba2...@yahoo.com
Cc: stephen sefick ssef...@gmail.com;
Sent: Fri, October 2, 2009 4:50:52 PM
Subject: Re: [R] How to speed up R with version 2.9.2?

Its under 5 seconds on my Vista laptop.  Do you have any startup files?  If
  Rgui --vanilla
is much faster then your startup files are the problem.

On Fri, Oct 2, 2009 at 11:45 AM, FMH kagba2...@yahoo.com wrote:
 Thank you for your answer. I'm using Win XP with 2GB RAM in memory.

 Cheers
 Fir



 - Original Message 
 From: stephen sefick ssef...@gmail.com
 To: FMH kagba2...@yahoo.com
 Cc: r-help@r-project.org
 Sent: Fri, October 2, 2009 4:38:10 PM
 Subject: Re: [R] How to speed up R with version 2.9.2?

 You're fine, but please do read the posting guide.  What OS etc.
 Where you doing anything else on the computer?  Is this a RAM
 limitation?  I have 2.9.2 running on two flavours of linux, mac os x
 and windows all 2.9.2 and there doesn't seem to be a problem.
 regards,

 Stephen

 On Fri, Oct 2, 2009 at 10:35 AM, FMH kagba2...@yahoo.com wrote:
 Dear All,

 I'm sorry if my question does not suit with this R group.

 I have recently installed R software with version 2.9.2, but i found the 
 program took almost 1 minute as soon as it was opened, before it can be 
 used. However, the previous version 2.9.1 only take few seconds after the 
 menu bar was clicked. This circumstance has caused me to wait for couple of 
 minutes as several R windows were opened simultaneously.

 Are there any ways to speed up on this 2.9.2 version? Could someone give 
 some hints, please?

 Thank you
 Fir




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




 --
 Stephen Sefick

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

                                 -K. Mullis





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






__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/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] Color of the plot which correspond to the group of the observations

2009-09-24 Thread FMH
Dear All,
 
Let:

dp: depth of the river
tp: temperature with respect to depth

These pair of observations are in 3 different groups i.e:
Obs. 1,3,5,7 from the first group
Obs. 2,4 and 10 from second group
Obs 6,8 and 9 from third group.

We can have a simple scatter plot, between depth as y-axis and temperature as 
x-axis, with each pairs are denoted by a red dot, by using a plot function 
shown below.
 
#
 dp - c(1,4,3,2,5,7,9,8,9,2)
 tp - 1:10
 plot(tp,dp, type= 'p', col = 'red')
 #

Could someone please give some advices on the way  to have a plot in which the 
color of each pair of observation corrrespond to its group? For instance, we 
might have red, blue and green dots corresponding to groups 1,2 and 3, 
respectively. 


Thank you
Fir




__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/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 in graph plotting

2009-09-23 Thread FMH
Dear All,

Let:
dp: depth of the river 
tp: temperature with respect to depth

We can have a simple scatter plot, between depth as y-axis and temperature as 
x-axis, by using a plot function as shown below.

# 
dp - c(1,4,3,2,5,7,9,8,9,2)
tp - 1:10
plot(tp,dp, type= 'l')
#
 
Could someone advice me on the way to plot the same pair of observations, but 
with depth in descending order from the origin. Instead of depth, I tried to 
simply use rev(depth), but the result was bizarre.
 
Thank you
Fir




__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/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 combine matrices?

2009-09-22 Thread FMH
Dear All,

Let a, b and c are three matrices with same no. of column but different no. of 
row.

a - matrix(1, 1, 2)
b - matrix(2, 2, 2)
c - matrix(3, 3, 2)

Could someone help me to combine these matrices together as a single matrix?

Thank you
Fir




__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/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 sort the elements in a matrix?

2009-09-22 Thread FMH
Dear All,

Let ab is the combination of matrices a and b.


a - matrix(c(1,2,3,4), nrow = 2, ncol = 2)
b - matrix(c(4,3,1,2), nrow = 2, ncol = 2)
ab - rbind(a, b)
 
From matrix ab, could someone give some advice on the way to sort all elements 
in column 2, by the sequence of the elements in column 1 in ascending order?
 
Thank you.
Fir




__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/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] Derivative of nonparametric curve

2009-09-14 Thread FMH
Thank you



- Original Message 
From: spencerg spencer.gra...@prodsyse.com
To: Liaw, Andy andy_l...@merck.com
Cc: Rolf Turner r.tur...@auckland.ac.nz; FMH kagba2...@yahoo.com; 
r-help@r-project.org
Sent: Wednesday, September 9, 2009 3:08:43 PM
Subject: Re: [R] Derivative of nonparametric curve

    This may be overkill for your application, but you might be interested in 
the fda package, for which a new book appeared a couple of months ago:  
Functional Data Analysis with R and Matlab (Springer Use R! series, by 
Ramsay, Hooker and Graves;  I'm the third author).  The package includes a 
scripts subdirectory with R code to recreate all but one of the 76 figures in 
the book.  [To find this scripts directory, use system.file('scripts', 
package='fda').] 

    Functional data analysis generalizes spline smoothing in two important 
ways: 

          (1) It supports the use of an arbitrary finite basis set to 
approximate elements of a function space;  spline smoothing uses splines only, 
usually cubic splines.  The first derivative of a cubic spline is piecewise 
quadratic, and the second derivative is piecewise linear.  If you want 
something smoother than linear, you need at least a quartic spline, and Ramsay 
has recommended quintics -- degree 5 polynomials = order 6 spline. 

          (2) It allows the curve to be smoothed using an arbitrary linear 
differential operator, not just the second derivative.  This can be important 
if you have theory saying that the truth should follow a particular 
differential equation.  Otherwise, if you want to estimate the second 
derivative, Ramsay has recommended smoothing with the fourth derivative rather 
than the second.  (In any event, smoothing is achieved by penalized least 
squares with the penalty being proportional to the integral of the square of 
the chosen linear differential operator.) 

    To reinforce this second point, chapter 11 of Functional Data Analysis 
with R and Matlab describes functional differential analysis, which will 
estimate non-constant coefficients in a differential equation model. 

    Hope this helps.      Spencer Graves


Liaw, Andy wrote:
 From: Rolf Turner
  
 On 8/09/2009, at 9:07 PM, FMH wrote:
 
    
 Dear All,
 
 I'm looking for a way on computing the derivative of first and  second 
 order of a smoothing curve produced by a nonprametric  regression. For 
 instance, if we run the R script below, a smooth  nonparametric regression 
 curve is produced.
 
 provide.data(trawl)
 Zone92  - (Year == 0  Zone == 1)
 Position - cbind(Longitude - 143, Latitude)
 dimnames(Position)[[2]][1] - Longitude - 143
 sm.regression(Longitude, Score1, method = aicc, col = red,  model = 
 linear)
 
 Could someone please give some hints on the way to find the  derivative on 
 the curve at some points ?
      
 See
 
     ?smooth.spline
 and
     ?predict.smooth.spline
    
 
 Since sm.regression() (from the sm package, I presume) uses kernel
 methods, a kernel-based estimator of derivatives is available in the
 KernSmooth package.
 
 Andy
    
     cheers,
 
         Rolf Turner
 
 ##
 Attention:\ This e-mail message is privileged and confid...{{dropped:9}}
 
 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.
 
    
 Notice:  This e-mail message, together with any attachme...{{dropped:12}}
 
 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.
 
  


-- Spencer Graves, PE, PhD
President and Chief Operating Officer
Structure Inspection and Monitoring, Inc.
751 Emerson Ct.
San José, CA 95126
ph:  408-655-4567


   
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/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] Color index in image function

2009-09-14 Thread FMH
Thank you





From: Henrique Dallazuanna www...@gmail.com

Cc: r-help@r-project.org
Sent: Sunday, September 6, 2009 4:30:14 PM
Subject: Re: [R] Color index in image function

Try this to see which colors the codes are:

Color - function(color){
    z - matrix(1:length(color), ncol = length(color))
    image(y = seq(1, length(color)), 
    z, col = color, axes = FALSE)
    text(0, y = z, labels = color, pos = 1, offset = 0, cex = 0.7)
}

Color(topo.colors(5))
Color(terrain.colors(10))

You can use levelplot from lattice package too.




Hi,

Thank you for your response. I'm looking for the names of the colors denoted 
by these  codes and what do these colors represent for.
For instance, if we use topo.colors(5) in the image function, five different 
colors will be used in which its codes are denoted as:

[1] #4C00 #004C #00E5 #00FF4DFF #00FF

So, my first question is what type of color do these codes represent for? Are 
they white, red,...?

My second question is, if we use this topo.colors(5) in image function to 
denote the temperature values for intance, what are these colors represent 
for? Does the first color, #4C00 represent the lower/medium/higher 
temperature?

I do hope you could advice me on this matter?

Thank you
Fir




- Original Message 

To: Steve Lianoglou mailinglist.honey...@gmail.com
Sent: Sunday, September 6, 2009 3:41:02 PM
Subject: Re: [R] Color index in image function

Hi,

Thank you for your response. I'm looking for the name of the colors denoted by 
this  code and what are these colors representing for.

For instance, if we use topo.colors(5) in the image function, five different 
colors will be used in which its codes are denoted as:

[1] #4C00 #004C #00E5 #00FF4DFF #00FF

So, my first question is what type of color does these codes represent 
for? Are they white, red,...?

My second question is, if we use this topo.colors(5) in image function to 
denote the temperature values for intance, what are these colors represent 
for? Does the first color, #4C00 represent the lower/medium/higher 
temperature?

I do hope you could advice me on this matter?

Thank you
Fir








- Original Message 
From: Steve Lianoglou mailinglist.honey...@gmail.com

Cc: r-help@r-project.org
Sent: Sunday, September 6, 2009 3:20:25 PM
Subject: Re: [R] Color index in image function

Hi,


 Dear All,

 I was looking for the color index in image function, such as from 
 topo.colors(n) and etc. but still never found it. For instance, from the 
 help menu.

The answer is in the code:

 ###
 # Volcano data visualized as matrix. Need to transpose and flip
 # matrix horizontally.
 image(t(volcano)[ncol(volcano):1,])

 # A prettier display of the volcano
 x - 10*(1:nrow(volcano))
 y - 10*(1:ncol(volcano))
 image(x, y, volcano, col = terrain.colors(100), axes = FALSE)

Right here:

R terrrain.colors(100)

[1] #00A600FF #03A700FF #07A800FF #0AAA00FF #0EAB00FF ...

Is that what you mean?
-steve

--
Steve Lianoglou
Graduate Student: Computational Systems Biology
| Memorial Sloan-Kettering Cancer Center
| Weill Medical College of Cornell University
Contact Info: http://cbio.mskcc.org/%7Elianos/contact




__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/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] Data in Array

2009-09-14 Thread FMH
Thank you


- Original Message 
From: jim holtman jholt...@gmail.com
To: FMH kagba2...@yahoo.com
Cc: Schalk Heunis schalk.heu...@enerweb.co.za; r-help@r-project.org
Sent: Tuesday, September 8, 2009 3:45:09 PM
Subject: Re: [R] Data in Array

Not sure what you mean by 'store', but you can use a list:

 a - matrix(1, nrow = 5, ncol = 1)
 b - matrix(2, nrow = 10, ncol = 1)
 c - matrix(3, nrow = 15, ncol = 1)
 myList - list(a, b, c)
 str(myList)
List of 3
$ : num [1:5, 1] 1 1 1 1 1
$ : num [1:10, 1] 2 2 2 2 2 2 2 2 2 2
$ : num [1:15, 1] 3 3 3 3 3 3 3 3 3 3 ...
 myList[[2]]
      [,1]
[1,]    2
[2,]    2
[3,]    2
[4,]    2
[5,]    2
[6,]    2
[7,]    2
[8,]    2
[9,]    2
[10,]    2




On Tue, Sep 8, 2009 at 8:14 AM, FMHkagba2...@yahoo.com wrote:
 Yes, but what actually i want to have is an array that might store these 
 different matrices.



 - Original Message 
 From: Schalk Heunis schalk.heu...@enerweb.co.za
 To: FMH kagba2...@yahoo.com
 Cc: r-help@r-project.org
 Sent: Tuesday, September 8, 2009 11:16:29 AM
 Subject: Re: [R] Data in Array

 have you tried rbind?


 On Tue, Sep 8, 2009 at 11:16 AM, FMHkagba2...@yahoo.com wrote:
 Dear All,

 I have some data which were stored in few  matrices with different orders. 
 Let have three different matrices a, b and c, which have the same number of 
 column but different number of row.


 a - matrix(1, nrow = 5, ncol = 1)
 b - matrix(2, nrow = 10, ncol = 1)
 c - matrix(3, nrow = 15, ncol = 1)

 How could i put all these matrices in an array?

 Thank you
 Kagba




 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/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.




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

What is the problem that you are trying to solve?





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


[R] gridlines in contour plot

2009-09-09 Thread FMH
Dear All,

Someone suggesting me to use the filled.contour function to plot the image 
together with the color index, and an example from the help menu is show below. 
 
#
require(grDevices) # for colours
filled.contour(volcano, color = terrain.colors, asp = 1)# simple
x - 10*1:nrow(volcano)
y - 10*1:ncol(volcano)
filled.contour(x, y, volcano, color = terrain.colors, 
    plot.title = title(main = The Topography of Maunga Whau,
    xlab = Meters North, ylab = Meters West),
    plot.axes = { axis(1, seq(100, 800, by = 100))
  axis(2, seq(100, 600, by = 100)) },
    key.title = title(main=Height\n(meters)),
    key.axes = axis(4, seq(90, 190, by = 10)))# maybe also asp=1
#
 
I am still trying to draw several gridlines with 10m gaps, which might 
represent the height of the mountain on the image but still can't manage it. 
 
Could someone please give some hints?
 
Thank you
Fir





__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/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] Derivative of nonparametric curve

2009-09-08 Thread FMH
Dear All,

I'm looking for a way on computing the derivative of first and second order of 
a smoothing curve produced by a nonprametric regression. For instance, if we 
run the R script below, a smooth nonparametric regression curve is produced. 

provide.data(trawl)
Zone92   - (Year == 0  Zone == 1)
Position - cbind(Longitude - 143, Latitude)
dimnames(Position)[[2]][1] - Longitude - 143
sm.regression(Longitude, Score1, method = aicc, col = red,  model = 
linear)

Could someone please give some hints on the way to find the derivative on the 
curve at some points ?

Thank you.
Kagba




__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/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] Data in Array

2009-09-08 Thread FMH
Dear All,

I have some data which were stored in few  matrices with different orders. Let 
have three different matrices a, b and c, which have the same number of column 
but different number of row.


a - matrix(1, nrow = 5, ncol = 1)
b - matrix(2, nrow = 10, ncol = 1)
c - matrix(3, nrow = 15, ncol = 1)

How could i put all these matrices in an array?

Thank you
Kagba




__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/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 in Array

2009-09-08 Thread FMH
Yes, but what actually i want to have is an array that might store these 
different matrices.



- Original Message 
From: Schalk Heunis schalk.heu...@enerweb.co.za
To: FMH kagba2...@yahoo.com
Cc: r-help@r-project.org
Sent: Tuesday, September 8, 2009 11:16:29 AM
Subject: Re: [R] Data in Array

have you tried rbind?


On Tue, Sep 8, 2009 at 11:16 AM, FMHkagba2...@yahoo.com wrote:
 Dear All,

 I have some data which were stored in few  matrices with different orders. 
 Let have three different matrices a, b and c, which have the same number of 
 column but different number of row.


 a - matrix(1, nrow = 5, ncol = 1)
 b - matrix(2, nrow = 10, ncol = 1)
 c - matrix(3, nrow = 15, ncol = 1)

 How could i put all these matrices in an array?

 Thank you
 Kagba




 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/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] Color index in image function

2009-09-07 Thread FMH
Thank you for the tips. I have manage to run your script, but  was still never 
get the way to include the color index beside the image which could explain the 
intensity of the color from the lower index(green) to the higher index(blue). 
This color index might be represented by  an increasing of color index in 
another table beside the image, started from green followed by green-yellow, 
yellow, yellow-blue and blue?

Could someone please advice on this matter?

Cheers
Fir



- Original Message 
From: Bernardo Rangel Tura t...@centroin.com.br
To: FMH kagba2...@yahoo.com
Sent: Monday, September 7, 2009 11:13:12 AM
Subject: Re: [R] Color index in image function

On Sat, 2009-09-05 at 04:14 -0700, FMH wrote:
 Dear All,
 
 I was looking for the color index in image function, such as from 
 topo.colors(n) and etc. but still never found it. For instance, from the help 
 menu.
 
 
 ###
 # Volcano data visualized as matrix. Need to transpose and flip
 # matrix horizontally.
 image(t(volcano)[ncol(volcano):1,])
 
 # A prettier display of the volcano
 x - 10*(1:nrow(volcano))
 y - 10*(1:ncol(volcano))
 image(x, y, volcano, col = terrain.colors(100), axes = FALSE)
 contour(x, y, volcano, levels = seq(90, 200, by = 5),
        add = TRUE, col = peru)
 axis(1, at = seq(100, 800, by = 100))
 axis(2, at = seq(100, 600, by = 100))
 box()
 title(main = Maunga Whau Volcano, font.main = 4)
 #
 
 From the script above, it yields a beautiful  image of volcano with variety 
 of colors but i have to list down the color index that could show the 
 meaning of each color in my thesis. 
 
 Could someone please help me to extract this color index?
 
 Thank you
 Fir

If I understand your question you need change the Palette of image plot.

So you need use colorRampPalette look my example

Brazilan.Pallete - colorRampPalette(c(green,yellow, blue))
image(x, y, volcano, col = Brazilan.Pallete(50), axes = FALSE)

-- 
Bernardo Rangel Tura, M.D,MPH,Ph.D
National Institute of Cardiology
Brazil




__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/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] Color index in image function

2009-09-06 Thread FMH
Hi,

Thank you for your response. I'm looking for the names of the colors denoted by 
these  codes and what do these colors represent for. 
For instance, if we use topo.colors(5) in the image function, five different 
colors will be used in which its codes are denoted as: 

[1] #4C00 #004C #00E5 #00FF4DFF #00FF

So, my first question is what type of color do these codes represent for? Are 
they white, red,...?

My second question is, if we use this topo.colors(5) in image function to 
denote the temperature values for intance, what are these colors represent 
for? Does the first color, #4C00 represent the lower/medium/higher 
temperature?

I do hope you could advice me on this matter?

Thank you
Fir




- Original Message 
From: FMH kagba2...@yahoo.com
To: Steve Lianoglou mailinglist.honey...@gmail.com
Sent: Sunday, September 6, 2009 3:41:02 PM
Subject: Re: [R] Color index in image function

Hi,

Thank you for your response. I'm looking for the name of the colors denoted by 
this  code and what are these colors representing for. 

For instance, if we use topo.colors(5) in the image function, five different 
colors will be used in which its codes are denoted as: 

[1] #4C00 #004C #00E5 #00FF4DFF #00FF

So, my first question is what type of color does these codes represent for? Are 
they white, red,...?

My second question is, if we use this topo.colors(5) in image function to 
denote the temperature values for intance, what are these colors represent 
for? Does the first color, #4C00 represent the lower/medium/higher 
temperature?

I do hope you could advice me on this matter?

Thank you
Fir







- Original Message 
From: Steve Lianoglou mailinglist.honey...@gmail.com
To: FMH kagba2...@yahoo.com
Cc: r-help@r-project.org
Sent: Sunday, September 6, 2009 3:20:25 PM
Subject: Re: [R] Color index in image function

Hi,

On Sat, Sep 5, 2009 at 7:06 AM, FMHkagba2...@yahoo.com wrote:
 Dear All,

 I was looking for the color index in image function, such as from 
 topo.colors(n) and etc. but still never found it. For instance, from the help 
 menu.

The answer is in the code:

 ###
 # Volcano data visualized as matrix. Need to transpose and flip
 # matrix horizontally.
 image(t(volcano)[ncol(volcano):1,])

 # A prettier display of the volcano
 x - 10*(1:nrow(volcano))
 y - 10*(1:ncol(volcano))
 image(x, y, volcano, col = terrain.colors(100), axes = FALSE)

Right here:

R terrrain.colors(100)

[1] #00A600FF #03A700FF #07A800FF #0AAA00FF #0EAB00FF ...

Is that what you mean?
-steve

-- 
Steve Lianoglou
Graduate Student: Computational Systems Biology
| Memorial Sloan-Kettering Cancer Center
| Weill Medical College of Cornell University
Contact Info: http://cbio.mskcc.org/~lianos/contact




__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/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] Color index in image function

2009-09-05 Thread FMH
Dear All,

I was looking for the color index in image function, such as from 
topo.colors(n) and etc. but still never found it. For instance, from the help 
menu.


###
# Volcano data visualized as matrix. Need to transpose and flip
# matrix horizontally.
image(t(volcano)[ncol(volcano):1,])

# A prettier display of the volcano
x - 10*(1:nrow(volcano))
y - 10*(1:ncol(volcano))
image(x, y, volcano, col = terrain.colors(100), axes = FALSE)
contour(x, y, volcano, levels = seq(90, 200, by = 5),
    add = TRUE, col = peru)
axis(1, at = seq(100, 800, by = 100))
axis(2, at = seq(100, 600, by = 100))
box()
title(main = Maunga Whau Volcano, font.main = 4)
#

From the script above, it yields a beautiful  image of volcano with variety of 
colors but i have to list down the color index that could show the meaning of 
each color in my thesis. 

Could someone please help me to extract this color index?

Thank you
Fir





__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/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] Color index in image function

2009-09-05 Thread FMH
Dear All,

I was looking for the color index in image function, such as from 
topo.colors(n) and etc. but still never found it. For instance, from the help 
menu.


###
# Volcano data visualized as matrix. Need to transpose and flip
# matrix horizontally.
image(t(volcano)[ncol(volcano):1,])

# A prettier display of the volcano
x - 10*(1:nrow(volcano))
y - 10*(1:ncol(volcano))
image(x, y, volcano, col = terrain.colors(100), axes = FALSE)
contour(x, y, volcano, levels = seq(90, 200, by = 5),
    add = TRUE, col = peru)
axis(1, at = seq(100, 800, by = 100))
axis(2, at = seq(100, 600, by = 100))
box()
title(main = Maunga Whau Volcano, font.main = 4)
#

From the script above, it yields a beautiful  image of volcano with variety of 
colors but i have to list down the color index that could show the meaning of 
each color in my thesis. 

Could someone please help me to extract this color index?

Thank you
Fir




__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/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] Differentiation on mathematical equation

2009-09-03 Thread FMH
Dear All,

I was trying to compute the first and second order differentiation on a number 
of mathematical equations, but never found any command in R to do this 
operation. At present, i have almost 3000 different functions, consist of 
polynomial, harmonic and several other functions.

Could someone please help me?

Thank you
Firdaus




__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/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] contour plot

2009-08-20 Thread FMH
Hi,

Could someone give some ideas on plotting a contour by using geoR package, 
please?

Thank you

Kagba


  
[[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] Problem with GroupedData

2009-07-14 Thread FMH
Hi,
 
I have an original data frame with 8 columns of variables, which are stored in 
'data1' frame.
 
data1 - read.csv(E:\\PHD GLASGOW UNIVERSITY\\Data\\R\\Colin\\Cailness21.csv)
attach(data1)
names(data1)
 
[1] Date   d  m  y  Time  
[6] Depth  Temp   Group_Time
 
 
Recently, i try two add a column into this data frame, but when i try to use 
the 'groupedData' function with this new data frame via command below, it 
reported the problem stated after the command below.
 
library(nlme)
tmp - groupedData(Temp ~ d | Depth, data2, order.groups = TRUE, labels = 
list(x = Month, y = Temperature), units = list(y = 0C))

Error in nfGroupedData(formula = Temp ~ d | Depth, data = data2, order.groups = 
TRUE,  : 
  second argument to groupedData must inherit from data.frame
 
 
Could someone help me to sort out on this problem, please?
 
Thank you
Fir



  
[[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] standard error and p-value for the estimated parameter in AR model

2009-06-22 Thread FMH
Dear All,

I used an  AR(1) model to explain the process of the stationary residual and 
have used an 'ar' command in R. From the results, i tried to extract 
the standard error and p-value for the estimated parameter, but unfortunately, 
i never find any way to extract  it from the output. 

What i did was, i assigned the residuals into the 'residual' object in R and 
used an 'ar' function as below. 

 residual - residuals
 ar(residual, aic = TRUE,  method = mle, order.max = 1) 

Could someone help me to extract the stadard error and the p-value for the 
estimated parameter, please?

Thank you

Fir


  
[[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] p-value for the parameter in ARIMA model with R

2009-06-17 Thread FMH
Dear All,

I decided to use an AR(1) model for the residual series and trying to find the 
p-value for each parameter by using arima command in R, but i never find it 
from the output. The output gives me the parameter and mean's value, its 
standard error, estaimated variance, AIC and loglikehood, but no p-value is 
given.

What i did was, i assign the residuals  into the 'residual' variable in R, i 
then use' arima(residual, order = c(1,0,0))' to compute the parameter and mean 
values.

Could someone help me?

Thank you
Fir



  
[[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] Correlation structure in AR(2) and ARMA(p,q)

2009-06-02 Thread FMH
Hi,

Let theta be the coefficient in AR(1) model, the components of the correlation 
structure is equal to 1 for times s = t, and theta^|t-s| for t  s. 

Could someone do me a favour to give some ideas on the correlation structure in 
AR(2) model and correlation structure of ARMA(p,q), as well?

Thank you

Fir


  
[[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] Spatiotemporal correlation function

2009-05-30 Thread FMH
Hi,

I'm trying to compute  the spatiotemporal correlation matrix by using Delta 
Kronecker products of spatial and temporal correlation matrix  in R, but didn't 
find any delta Kronecker's operator in R. The operators in matrix such as 
multiplication, addition, eigen values/vector and etc is easily to find and 
used.

Could someone help me, please?

Cheers.

Firdaus



  
[[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] Delta Kronecker

2009-05-28 Thread FMH
Hi,

Could some give some ideas on how to compute the spatiotemporal covariance 
matrix by a sum of Kronecker products in R. Is there any special function that 
can be used?

Cheers.

Firdaus



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