# [R] How to solve this?

SITI AISYAH ZAKARIA @|@y@hz@k@r|@ @end|ng |rom un|m@p@edu@my
Mon Aug 30 10:21:44 CEST 2021

```Dear all,

Can anyone help me? I'm using this coding to get the spatial gev model and
plotting the quantile plot to justify the model is fit but the plot look
like not fit.. How can I solve this? It is I need to change in the any
value at the coding.For example I want to change form.shape <-shape ~1 to
form.shape <- shape ~average shape but is not available for average coding.

below is my coding

#----------------------------------------------------------------------------------------------
# fitspatgev
#----------------------------------------------------------------------------------------------
# response surface model
Ozone<-data.matrix(Ozone_S)
Ozone
LotLatAlt<-data.matrix(OzoneLotLatAlt_S)
LotLatAlt
form.loc <- loc ~ Lon + Lat + Alt
form.scale <- scale ~ 1
form.shape <- shape ~ 1
dim(Ozone_S)
dim(OzoneLotLatAlt_S)
fit1 <- fitspatgev(Ozone, scale(LotLatAlt,scale=FALSE), form.loc,
form.scale, form.shape);fit1
TIC(fit1)
fit1\$param
#data(rain
#symbolplot(rain, coord, plot.border = swiss)
#check the fit of the model: compute QQplots for each station
par(mfrow=c(1,3))
par(mar=c(3,2.5,1.5,0.5),mgp=c(1.5,0.5,0),font.main=1,cex=0.66,cex.main=1)
#calculation of confidance intervals
nc <- 10000
M1 <- matrix(rfrechet(nc*nobs),nrow=nobs,ncol=nc)
M <- t(apply(M1,2,sort))
E <- boot::envelope(mat=M) #compute 95% confidance bands
for (k in c(1:3,4,5,6)){ #choose some stations
park <- predict(fit1)[k,]
fk <- gev2frech(Ozone[,k],loc=park[4],scale=park[5],shape=park[6])
qqplot(y=fk,x=qfrechet((1:nobs)/(nobs+1)),log='xy',main=k,ylab='Sample
Quantiles',xlab='Theoretical Quantiles',cex=0.7);
abline(0,1)
lines(y=E\$overall[1,],x=qfrechet((1:nobs)/(nobs +1)),lty='dotted')
lines(y=E\$overall[2,],x=qfrechet((1:nobs)/(nobs +1)),lty='dotted')
}

the quantile plot is in attachment file.

thank you

--

"..Millions of trees are used to make papers, only to be thrown away
after a couple of minutes reading from them. Our planet is at stake. Please
be considerate. THINK TWICE BEFORE PRINTING THIS.."

DISCLAIMER: This email
and any files transmitted with it are confidential and intended solely for
the use of the individual orentity to whom they are addressed. If you have
email are solely those of the author and do not necessarily represent those
of the university. Finally, the recipient should check this email and any
attachments for the presence of viruses.The university accepts no liability
for any damage caused by any virus transmitted by this email.

Universiti
Malaysia Perlis (UniMAP) | Digital Management & Development Centre (DMDC),
Universiti Malaysia Perlis (UniMAP), Pauh Putra Campus, 02600 Arau, Perlis,
MALAYSIA | www.unimap.edu.my <http://www.unimap.edu.my/>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 6bdf71f9-f33f-4c53-bf12-1e21e9c55b26.png
Type: image/png
Size: 6679 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20210830/033f6705/attachment.png>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 45d43732-cc62-4c43-8659-97ca2d7134c5.png
Type: image/png
Size: 6573 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20210830/033f6705/attachment-0001.png>
```