You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Workshop participant asked how to set $\alpha$ for confidence interval widths other than 95%. Checking the arguments and description of ds() there does not appear to be a way to specify $\alpha$.
In mrds confidence interval calculations occur via dht.se and in the control list for dht there is an entry ci.width. But no way to access this via ds()
This from documentation for mrds::dht
Some dht_options are set by ds() in lines following 731
Perhaps $\alpha$ could be added as an argument to ds() and set around line 731 to be passed to dht
I created a branch for this request - branch Issue_215. In that, I added an argument conf_level to the ds function. I used this argument name as it's what's used in other packages that produce confidence intervals such as PropCIs (well, they use conf.level but our convention is to use an underscore). Here's some code that exercises that argument:
yes, this all looks good; argument is even added to documentation.
Vaguely related to this is how user specifies CI desires for bootdht. The function summary.dht_bootstrap (note interesting coding convention use of . and _) asks the user to specify $\alpha$ rather than $1-\alpha$ as is done with dht. But that might be for another day.
Thanks for pointing that out. How about I create an alpha argument for ds that has no default, so has no effect if you don't use it, but if you do it takes precidence over conf_level? That way the user can use either. (I could also create a conf_level argument for summary.dht_bootstrap.)
The mixture of dot and underscore in summary.dht_bootstrap is because we're using S3 classes in the Distance package and the dot is how you tell R that this function is a summary function for the dht_bootstrap class. Clunky, but S3 has been around for yonks and that's how it works.
Indeed, with this in mind I added an alpha argument to ds, tested, and merged in with the main branch. I didn't add conf_level to dht_bootstrap as that's complicated enough as is, so I thought I'd leave it. I'll close this issue now - please can you pass back info about the new feature to your workshop participant.
Don't think this is closed yet, see my comment in pull request #217#217
Something not quite right about roxygen I'm guessing. You changed ds.R, but those changes did not propagate into ds.Rd in the documentation. Github actions noticed this and complained the two files are inconsistent.
Activity
lenthomas commentedon Oct 16, 2025
I created a branch for this request - branch Issue_215. In that, I added an argument
conf_levelto thedsfunction. I used this argument name as it's what's used in other packages that produce confidence intervals such asPropCIs(well, they useconf.levelbut our convention is to use an underscore). Here's some code that exercises that argument:@erex Let me know what you think and if okay I'll merge with the main branch. Thanks for making it so easy to work out what to do!
erex commentedon Oct 17, 2025
yes, this all looks good; argument is even added to documentation.
Vaguely related to this is how user specifies CI desires for$\alpha$ rather than $1-\alpha$ as is done with
bootdht. The functionsummary.dht_bootstrap(note interesting coding convention use of.and_) asks the user to specifydht. But that might be for another day.lenthomas commentedon Oct 17, 2025
Thanks for pointing that out. How about I create an
alphaargument fordsthat has no default, so has no effect if you don't use it, but if you do it takes precidence overconf_level? That way the user can use either. (I could also create aconf_levelargument for summary.dht_bootstrap.)The mixture of dot and underscore in summary.dht_bootstrap is because we're using S3 classes in the
Distancepackage and the dot is how you tellRthat this function is a summary function for thedht_bootstrapclass. Clunky, but S3 has been around for yonks and that's how it works.erex commentedon Oct 17, 2025
I'm relaxed about what you do with
alphaandconf_level. Would be nice if there was consistency between functions within our packages.lenthomas commentedon Oct 17, 2025
Indeed, with this in mind I added an alpha argument to ds, tested, and merged in with the main branch. I didn't add conf_level to dht_bootstrap as that's complicated enough as is, so I thought I'd leave it. I'll close this issue now - please can you pass back info about the new feature to your workshop participant.
erex commentedon Oct 17, 2025
Don't think this is closed yet, see my comment in pull request #217 #217
Something not quite right about roxygen I'm guessing. You changed
ds.R, but those changes did not propagate intods.Rdin the documentation. Github actions noticed this and complained the two files are inconsistent.lenthomas commentedon Oct 17, 2025
Thanks, clearly I am out of date with this stuff. I ran devtools::document() and pushed the new .Rd. Should all be fine now.