[R-sig-Geo] A question about gwr.morantest pvalue
Roger Bivand
Roger.Bivand at nhh.no
Wed Feb 22 11:22:46 CET 2012
On Thu, 16 Feb 2012, Apostolis wrote:
> Dear list members
>
> I am a new user of R and I would like to ask a question about the function
> gwr.morantest which is included in the spgwr package.
>
> According to the paper of Leung et al page 881
> when
> EQ.EQ3.gwr > 0 the pvalue of the test is P(chisqh<= chi2.gwr)
> (equation 43)
>
> and when
>
> EQ.EQ3.gwr < 0 the pvalue is 1 - P(chisqh<= chi2.gwr) (equation 44)
>
> However in the function gwr.morantest the estimations in the IF are
> respectively:
>
> if (EQ.EQ3.gwr > 0) {
> chi2.gwr <- h.gwr - ((sqrt(2 * h.gwr) * EQ.gwr)/(sqrt(varQ.gwr)))
> p.gwr <- 1 - pchisq(chi2.gwr, h.gwr)
> }
> else if (EQ.EQ3.gwr < 0) {
> chi2.gwr <- (h.gwr + ((sqrt(2 * h.gwr) * EQ.gwr)/(sqrt(varQ.gwr))))
> p.gwr <- pchisq(chi2.gwr, h.gwr)
> }
>
> Is it correct or there is an error? My problem is in the appearance of 1 in
> p.gwr inside the IF.
There is no "correct" here, as ?pchisq shows that if lower.tail= is not
set it is taken by default to be TRUE. You will need to check this
yourself. Note that GWR is a notoriously unreliable technique, and
simulation studies indicate that it finds pattern in coefficients even
when there is none. So any tests are doubtful anyway - it should only be
used for exploring the data for possible missing variables or
inappropriate functional forms.
Hope this clarifies,
Roger
>
> I wish to use the gwr.morantest function in a simulation study and I would
> like to know whether the function estimates the pvalue which is described in
> the paper correctly.
>
> Thanks in advance
> Apostolis
>
>
>
>
>
> --
> View this message in context: http://r-sig-geo.2731867.n2.nabble.com/A-question-about-gwr-morantest-pvalue-tp7292670p7292670.html
> Sent from the R-sig-geo mailing list archive at Nabble.com.
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>
--
Roger Bivand
Department of Economics, NHH Norwegian School of Economics,
Helleveien 30, N-5045 Bergen, Norway.
voice: +47 55 95 93 55; fax +47 55 95 95 43
e-mail: Roger.Bivand at nhh.no
More information about the R-sig-Geo
mailing list