[R] tweedie.profile error message
Joanne Lenehan
jlenehan at une.edu.au
Mon Jan 11 07:59:07 CET 2010
Good afternoon
My name is Joanne Lenehan, I am a post grad at UNE using R version 2.9.0
I came across the Tweedie package in old R help posts and was interested in
giving it a go for some data.
The data is below and also attached as BaregroundLitterLogs
Site
Treatment
Graze
Dam
Plot
Time
Bare
Litter
Logs
1
C
remote
yes
1
A
0
2
0
1
C
remote
yes
2
A
0
15
0
1
HE
remote
yes
1
A
0
4
5
1
HE
remote
yes
2
A
0
4
0
1
AHE
remote
yes
1
A
0
1
0
1
AHE
remote
yes
2
A
0
5
0
2
C
remote
no
1
A
0
10
2
2
C
remote
no
2
A
0
22
7
2
HE
remote
no
1
A
0
0
2
2
HE
remote
no
2
A
0
10
0
2
AHE
remote
no
1
A
1
25
2
2
AHE
remote
no
2
A
0
2
0
3
C
remote
yes
1
A
5
20
0
3
C
remote
yes
2
A
7
15
6
3
HE
remote
yes
1
A
5
20
3
3
HE
remote
yes
2
A
0
3
0
3
AHE
remote
yes
1
A
3
1
0
3
AHE
remote
yes
2
A
6
3
2
4
C
close
no
1
A
0
5
1
4
C
close
no
2
A
5
25
6
4
HE
close
no
1
A
10
6
0
4
HE
close
no
2
A
10
15
0
4
AHE
close
no
1
A
10
10
0
4
AHE
close
no
2
A
5
7
3
5
C
close
yes
1
A
0
7
0
5
C
close
yes
2
A
0
20
7
5
HE
close
yes
1
A
0
25
5
5
HE
close
yes
2
A
0
20
0
5
AHE
close
yes
1
A
0
15
2
5
AHE
close
yes
2
A
0
25
0
6
C
close
no
1
A
1
25
7
6
C
close
no
2
A
0
10
0
6
HE
close
no
1
A
5
5
2
6
HE
close
no
2
A
2
0
0
6
AHE
close
no
1
A
5
5
0
6
AHE
close
no
2
A
0
15
1
1
C
remote
yes
1
B
0
5
0
1
C
remote
yes
2
B
0
11
1
1
HE
remote
yes
1
B
0
3.5
4
1
HE
remote
yes
2
B
0
10
0
1
AHE
remote
yes
1
B
0
6
1
1
AHE
remote
yes
2
B
0
8
1
2
C
remote
no
1
B
3
7
2
2
C
remote
no
2
B
0
10
5
2
HE
remote
no
1
B
0
6
2
2
HE
remote
no
2
B
0
8
2
2
AHE
remote
no
1
B
2
20
2
2
AHE
remote
no
2
B
0
5
0
3
C
remote
yes
1
B
5
14
2
3
C
remote
yes
2
B
7
16.5
5
3
HE
remote
yes
1
B
5
10
3
3
HE
remote
yes
2
B
0
6
1
3
AHE
remote
yes
1
B
4
4.5
0
3
AHE
remote
yes
2
B
2
3
2
4
C
close
no
1
B
2
6
0
4
C
close
no
2
B
8
14.5
4
4
HE
close
no
1
B
5
7
1
4
HE
close
no
2
B
5
12.5
0
4
AHE
close
no
1
B
7
7.5
0
4
AHE
close
no
2
B
1
9
2
5
C
close
yes
1
B
0
9
0
5
C
close
yes
2
B
2
13
6
5
HE
close
yes
1
B
1
17
4
5
HE
close
yes
2
B
0
11
1
5
AHE
close
yes
1
B
0
12.5
1
5
AHE
close
yes
2
B
1
15
1
6
C
close
no
1
B
2
7
5
6
C
close
no
2
B
3
12
0
6
HE
close
no
1
B
2
9.5
2
6
HE
close
no
2
B
2
4.5
1
6
AHE
close
no
1
B
0
5
0
6
AHE
close
no
2
B
2
10
1
1
C
remote
yes
1
C
0
6
1
1
C
remote
yes
2
C
2
10
1
1
HE
remote
yes
1
C
0
4
4
1
HE
remote
yes
2
C
0
9
0
1
AHE
remote
yes
1
C
0
8
1
1
AHE
remote
yes
2
C
0
9
1
2
C
remote
no
1
C
3
7
2
2
C
remote
no
2
C
0
8
6
2
HE
remote
no
1
C
0
7
1
2
HE
remote
no
2
C
0
10
1
2
AHE
remote
no
1
C
1
17
2
2
AHE
remote
no
2
C
0
5
0
3
C
remote
yes
1
C
4
8
2
3
C
remote
yes
2
C
8
13
4
3
HE
remote
yes
1
C
3
8
2
3
HE
remote
yes
2
C
0
7
1
3
AHE
remote
yes
1
C
2
7
0
3
AHE
remote
yes
2
C
0
5
2
4
C
close
no
1
C
3
5
0
4
C
close
no
2
C
9
12
4
4
HE
close
no
1
C
3
9.5
1
4
HE
close
no
2
C
5
11
0
4
AHE
close
no
1
C
7
8
0
4
AHE
close
no
2
C
0
9
2
5
C
close
yes
1
C
3
7
0
5
C
close
yes
2
C
2
8
5
5
HE
close
yes
1
C
0
15
4
5
HE
close
yes
2
C
0
12
1
5
AHE
close
yes
1
C
0
10
1
5
AHE
close
yes
2
C
0
14
2
6
C
close
no
1
C
3
4
5
6
C
close
no
2
C
5
8
1
6
HE
close
no
1
C
2
7
2
6
HE
close
no
2
C
0
4
2
6
AHE
close
no
1
C
0
5
1
6
AHE
close
no
2
C
2
10
1
1
C
remote
yes
1
D
0
6
1
1
C
remote
yes
2
D
2
8
1
1
HE
remote
yes
1
D
0
6
3
1
HE
remote
yes
2
D
0
8
1
1
AHE
remote
yes
1
D
0
6
0
1
AHE
remote
yes
2
D
0
10
1
2
C
remote
no
1
D
3
8
2
2
C
remote
no
2
D
0
6
5
2
HE
remote
no
1
D
0
4
2
2
HE
remote
no
2
D
0
9
2
2
AHE
remote
no
1
D
2
15
2
2
AHE
remote
no
2
D
0
5
0
3
C
remote
yes
1
D
5
7
2
3
C
remote
yes
2
D
7
10
4
3
HE
remote
yes
1
D
3
10
2
3
HE
remote
yes
2
D
0
7
1
3
AHE
remote
yes
1
D
2
7
0
3
AHE
remote
yes
2
D
0
5
2
4
C
close
no
1
D
3
5
0
4
C
close
no
2
D
9
8
4
4
HE
close
no
1
D
4
12
2
4
HE
close
no
2
D
5
10
1
4
AHE
close
no
1
D
6
8
0
4
AHE
close
no
2
D
0
10
1
5
C
close
yes
1
D
2
9
0
5
C
close
yes
2
D
2
8
5
5
HE
close
yes
1
D
0
16.5
4
5
HE
close
yes
2
D
0
14
1
5
AHE
close
yes
1
D
0
12
2
5
AHE
close
yes
2
D
1
12
2
6
C
close
no
1
D
5
7
5
6
C
close
no
2
D
5
6
2
6
HE
close
no
1
D
0
8.5
2
6
HE
close
no
2
D
0
5
2
6
AHE
close
no
1
D
0
6.5
2
6
AHE
close
no
2
D
1
12
2
1
C
remote
yes
1
E
0
6
1
1
C
remote
yes
2
E
2
9
1
1
HE
remote
yes
1
E
0
6
4
1
HE
remote
yes
2
E
0
7
1
1
AHE
remote
yes
1
E
0
7
1
1
AHE
remote
yes
2
E
0
9
1
2
C
remote
no
1
E
2
8
2
2
C
remote
no
2
E
0
6
5
2
HE
remote
no
1
E
0
6
2
2
HE
remote
no
2
E
0
8
2
2
AHE
remote
no
1
E
2
13
2
2
AHE
remote
no
2
E
0
4
0
3
C
remote
yes
1
E
4
7
2
3
C
remote
yes
2
E
6
7
4
3
HE
remote
yes
1
E
3
12
2
3
HE
remote
yes
2
E
0
7
2
3
AHE
remote
yes
1
E
2
6.5
0
3
AHE
remote
yes
2
E
0
8
2
4
C
close
no
1
E
5
5.5
0
4
C
close
no
2
E
6
7
4
4
HE
close
no
1
E
2
12
2
4
HE
close
no
2
E
4
14.5
1
4
AHE
close
no
1
E
5
9.5
0
4
AHE
close
no
2
E
0
12
2
5
C
close
yes
1
E
1
8
0
5
C
close
yes
2
E
2
8
5
5
HE
close
yes
1
E
0
15
4
5
HE
close
yes
2
E
0
12
2
5
AHE
close
yes
1
E
0
14
2
5
AHE
close
yes
2
E
1
18
3
6
C
close
no
1
E
5
6
5
6
C
close
no
2
E
5
7
2
6
HE
close
no
1
E
0
9
2
6
HE
close
no
2
E
0
5
2
6
AHE
close
no
1
E
0
9
2
6
AHE
close
no
2
E
1
10
2
1
C
remote
yes
1
F
0
5
0
1
C
remote
yes
2
F
2
10
1
1
HE
remote
yes
1
F
0
7
5
1
HE
remote
yes
2
F
0
10
1
1
AHE
remote
yes
1
F
0
6
1
1
AHE
remote
yes
2
F
0
11
1
2
C
remote
no
1
F
2
7.5
2
2
C
remote
no
2
F
0
6.5
5
2
HE
remote
no
1
F
0
6
3
2
HE
remote
no
2
F
0
9
2
2
AHE
remote
no
1
F
0
12
2
2
AHE
remote
no
2
F
0
5.5
0
3
C
remote
yes
1
F
5
9
2
3
C
remote
yes
2
F
7
8
4
3
HE
remote
yes
1
F
2
12.5
2
3
HE
remote
yes
2
F
0
8
2
3
AHE
remote
yes
1
F
0
6.5
2
3
AHE
remote
yes
2
F
0
8
0
4
C
close
no
1
F
5
7
3
4
C
close
no
2
F
8
6
4
4
HE
close
no
1
F
2
11
1
4
HE
close
no
2
F
4
14
0
4
AHE
close
no
1
F
5
8
0
4
AHE
close
no
2
F
0
12
2
5
C
close
yes
1
F
1
9
0
5
C
close
yes
2
F
3
10
5
5
HE
close
yes
1
F
0
15.5
4
5
HE
close
yes
2
F
0
11
0
5
AHE
close
yes
1
F
0
16
2
5
AHE
close
yes
2
F
1
12
2
6
C
close
no
1
F
5
7
5
6
C
close
no
2
F
5
3
2
6
HE
close
no
1
F
0
8
1
6
HE
close
no
2
F
0
5
2
6
AHE
close
no
1
F
0
8
2
6
AHE
close
no
2
F
1
11
2
The response variables are "Litter", "Bareground", "Logs" (measured by
visually estimating % cover in a plot in a grazing exclusion experiment)
The three factors are fixed and are "Site" - 6 levels; "Treatment" - 3
levels; and "Time" - 6 levels
Additional factors are "Graze" and "Dam" but are constructs on top of the
sites, that is Sites 1,3,5 have dams adjacent while Sites 2,4,6 do not and
Sites 1,2,3 are remote from a spur which feral horses use to move from the
low river country to the high country where the experiment is taking place
and thus have higher grazing pressure and Sites 4,5,6 are close to this
access spur. So I do three analyses when relevant, one looking at the three
factors and then taking site out and replacing it with graze and then dam.
It is a grazing exclusion experiment to test effects of feral horse grazing
on a number of variables whereby C=controls so open to all herbivores, HE=
Horses excluded but allowing other herbivores such as macropods, rabbits,
and AHE= is a fully enclosed high wire fence excluding all herbivores. One
treatment exclosure type was erected at each site but within these 30m2
exclosures there were two randomly located 5x6m plots so that is why there
are two treatment replicates at each site even though there was only one
exclosure at each site.
I have analysed biomass for example already using
##this is the general linear model analysis, fitting a variation of the
gamma distribution
model3<-glm(Biomass~(Treatment+Time+Site)^3, data=bobB,
family=quasi(link="log", variance="mu"))
based upon initial data exploration and what the residuals were doing, that
is the reason the residuals were spreading out was because I had a Gamma
type error distribution and that model worked really well with the
diagnostic plots.
The biomass data is attached with the litter file for reference.
When it came to analysing the per cent cover of bareground, litter and logs
especially for bareground and logs as you can see by the data below it
appears to be continuous positive data with lots of zeros and I came across
another R help posting where somebody suggested using Tweedie package so
thought would give it a go. I have tried to use tweedie.profile function
but keep getting the following:
Code entered:
require(statmod)
require(tweedie)
out<-with(bobB, tweedie.profile(Litter~Treatment*Time*Site,
p.vec=seq(1.05,1.95, length=10), method="interpolation", do.ci=TRUE,
do.smooth=TRUE, do.plot=TRUE))
out$p.max
model7<-(with(bobB, glm(Litter~Treatment*Time*Site,
family=tweedie(var.power=out$p.max, link.power=0))))
print(anova(model7, test="Chisq"))
summary(model7)
par(mfrow=c(2,2))
plot(model7)
BUT get
> out<-with(bobB, tweedie.profile(Litter~Treatment*Time*Site,
p.vec=seq(1.1,1.9, length=10), method="series", do.ci=TRUE, do.smooth=TRUE,
do.plot=TRUE))
Computing for p =1.1, 1.188889, 1.277778, 1.366667, 1.455556, 1.544444,
1.633333, 1.722222, 1.811111, 1.9, Done.
Warning messages:
1: In tweedie.profile(Litter ~ Treatment * Time * Site, p.vec = seq(1.1, :
True maximum possibly not detected.
2: In tweedie.profile(Litter ~ Treatment * Time * Site, p.vec = seq(1.1, :
Confidence interval cannot be found: insufficient data to find left CI.
> out$p.max
[1] 1.1
And for bareground even more messages and warnings
>
> out<-with(bobB, tweedie.profile(Bareground~Treatment*Time*Site,
p.vec=seq(1.1,1.9, length=10), method="interpolation", do.ci=TRUE,
do.smooth=TRUE, do.plot=TRUE))
Computing for p =1.1, 1.188889, 1.277778, 1.366667, 1.455556, 1.544444,
1.633333, 1.722222, 1.811111, 1.9, Done.
Warning messages:
1: In glm.fit(x = model.x, y = ydata, weights = weights, offset = offset, :
algorithm did not converge
2: In glm.fit(x = model.x, y = ydata, weights = weights, offset = offset, :
algorithm did not converge
3: In glm.fit(x = model.x, y = ydata, weights = weights, offset = offset, :
algorithm did not converge
4: In glm.fit(x = model.x, y = ydata, weights = weights, offset = offset, :
algorithm did not converge
5: In glm.fit(x = model.x, y = ydata, weights = weights, offset = offset, :
algorithm did not converge
6: In glm.fit(x = model.x, y = ydata, weights = weights, offset = offset, :
algorithm did not converge
7: In glm.fit(x = model.x, y = ydata, weights = weights, offset = offset, :
algorithm did not converge
8: In glm.fit(x = model.x, y = ydata, weights = weights, offset = offset, :
algorithm did not converge
9: In tweedie.profile(Bareground ~ Treatment * Time * Site, p.vec = seq(1.1,
:
True maximum possibly not detected.
10: In tweedie.profile(Bareground ~ Treatment * Time * Site, p.vec =
seq(1.1, :
Confidence interval cannot be found: insufficient data to find left CI.
> out$p.max
[1] 1.1
I am not very adept at statistics and am struggling through but would
appreciate if anyone could explain why those error messages occur and if
that means I cannot use the out$p.max value computed, I would presume not as
if you change the p.vec specs to say 1.05 that is the out$p.max value
computed (e.g. 1.1 or 1.05) and what perhaps I could do to fix that or if
the data is not suitable for this type of analysis. Perhaps should just
continue with quasi or poisson with log link
Kindest regards
Jo Lenehan
PhD Candidate
University of New England
Armidale NSW 2351
02 6773 3723
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: BaregroundLitterLogs.txt
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20100111/6f3d6ed3/attachment.txt>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: Bioalltimeamen.txt
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20100111/6f3d6ed3/attachment-0001.txt>
More information about the R-help
mailing list