I am estimating a large model by groups. How do you save the results 
and returns 
the associated quantiles?
For this example I need a data frame 
n    xi        mu        beta 
1   0.1033614  2.5389580 0.9092611
2   0.3401922  0.5192882 1.5290615 
3   0.5130798  0.5668308 1.2105666
I also want to apply gevrlevelPlot() for each "n" or group.
 
#Example
n <- c(1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3,3)
y <- c(2,3,2,3,4,5,6,1,0,0,0,6, 2, 1, 0, 0,9,3)
z <- as.data.frame(cbind(n,y))
colnames(z) <- c("n","y")
library(fExtremes)
z <- split(z, z$n)
res2 <-lapply(z, function(x){
               m <- as.numeric(x$y)
               gevFit(m, block = 1, type = c("pwm"))
                })
> res2
$`1`
Title:
 GEV Parameter Estimation 
Call:
 gevFit(x = m, block = 1, type = c("pwm"))
Estimation Type:
  gev pwm 
Estimated Parameters:
       xi        mu      beta 
0.1033614 2.5389580 0.9092611 
Description
  Wed Jun 29 23:07:48 2011 

$`2`
Title:
 GEV Parameter Estimation 
Call:
 gevFit(x = m, block = 1, type = c("pwm"))
Estimation Type:
  gev pwm 
Estimated Parameters:
       xi        mu      beta 
0.3401922 0.5192882 1.5290615 
Description
  Wed Jun 29 23:07:48 2011 

$`3`
Title:
 GEV Parameter Estimation 
Call:
 gevFit(x = m, block = 1, type = c("pwm"))
Estimation Type:
  gev pwm 
Estimated Parameters:
       xi        mu      beta 
0.5130798 0.5668308 1.2105666 
Description
  Wed Jun 29 23:07:48 2011 


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

Reply via email to