Skip to content

Distance analysing binned data using arguments instead of distend / distbegin when distance is not in dataset #144

@LHMarshall

Description

@LHMarshall

When both distbegin / distend area supplied in the dataset along with the arguments cutpoints and width in the function call you get a warning message saying that distbegin / distend are being ignored. In this case there was no column distance hence it was unclear what the detection function was being fitted to.

# There is no distance column
> dat[1,]
  Region.Label Area Sample.Label Species Effort distbegin distend size object
1       forest    1        FP123    YBBU      3        20      30    1      1

> # Don't know why this works as there is no column distance so shouldn't work
> x1<-ds(data = dat, transect = "point", formula=~1, key = "hn", 
+       adjustment = NULL, truncation =list(left=0,right=30), 
+       cutpoints = c(0,5,10,15,20,30), convert_units = conversion.factor)
data already has distend and distbegin columns, removing them and appling binning as specified by cutpoints.
Fitting half-normal key function
AIC= 167.049

Also results are inconsistent between the following 2 models when they should be identical

> # Try to achieve analysis with truncation of 30
> dat2 <- dat
> # Make a distance column
> dat2$distance <- (dat$distbegin+dat$distend)/2
> # Re-cut data as per bins
> x3<-ds(data = dat2, transect = "point", formula=~1, key = "hn", 
+        adjustment = NULL, truncation =list(left=0,right=30), 
+        cutpoints = c(0,5,10,15,20,30), convert_units = conversion.factor)
data already has distend and distbegin columns, removing them and appling binning as specified by cutpoints.
Fitting half-normal key function
AIC= 167.049
> plot(x3)
> # Now try same analysis with using distbegin / distend
> # Need to subset data
> dat3 <- dat[dat$distend <= 30,]
> View(dat3)
> x4<-ds(data = dat3, transect = "point", formula=~1, key = "hn", 
+        adjustment = NULL, convert_units = conversion.factor)
Columns "distbegin" and "distend" in data: performing a binned analysis...
Fitting half-normal key function
AIC= 159.573
> plot(x4)

x3 model plot:
image

x4 model plot (not the strange additional point at distance 5)
image

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions