Skip to contents

This function performs a template regression on the provided reference and source tables to estimate the beta weights for the baseline and source maps.

Usage

template_regression(
  ref_tab,
  source_tab,
  match_on,
  baseline_tab,
  baseline_key,
  method = c("lm", "rlm", "rank"),
  density_var = "density"
)

Arguments

ref_tab

A data frame containing the reference maps.

source_tab

A data frame containing the source maps.

match_on

A character string specifying the column name to be used for matching between the reference and source tables.

baseline_tab

A data frame containing the baseline maps. Each baseline_key value used by source_tab must appear in exactly one row; duplicated keys are an error.

baseline_key

A character string specifying the column name to be used for matching between the baseline table and the source table.

method

A character vector of available regression methods. Default is c("lm", "rlm", "rank"). The selected method will be used for the regression analysis. - "lm": Linear regression (default). - "rlm": Robust linear regression. - "rank": Rank-based correlation.

density_var

Name of the column holding the density maps in all three tables (default `"density"`, the `result_name` used by density_by).

Value

A data frame with the source table augmented with two new columns, beta_baseline and beta_source, representing the estimated beta weights for the baseline and source maps, respectively.