Skip to contents

Calculates the mean and standard deviation of all numeric variables in a dataframe or tibble.

Usage

make_param_table(analysis_data, na.rm = TRUE)

Arguments

analysis_data

A dataframe or tibble.

na.rm

Logical. Should missing values be removed?

Value

A tibble.

Details

The parameter table is used in the computation of Z-values during the standardisation of out-of-sample predictions with pred_to_Zr(). make_param_table() returns a tidy, long-form tibble with the variable names of analysis_data stored in columnvariable, the corresponding parameter ("mean" or "sd"), and the value of that parameter.

Note

Currently variable names of analysis_data must not contain . because this character is used to split the variable from the parameter during pivot_longer()

See also

The table from this function is used to standardize out-of-sample predictions $y_i$ in pred_to_Z()

Examples

make_param_table(ManyEcoEvo::blue_tit_data)
#> # A tibble: 34 × 3
#>    variable            parameter      value
#>    <chr>               <chr>          <dbl>
#>  1 hatch_year          mean        2002.   
#>  2 hatch_year          sd             0.787
#>  3 hatch_nest_breed_ID mean      202139.   
#>  4 hatch_nest_breed_ID sd           769.   
#>  5 hatch_nest_OH       mean          41.7  
#>  6 hatch_nest_OH       sd             8.54 
#>  7 rear_nest_breed_ID  mean      202140.   
#>  8 rear_nest_breed_ID  sd           771.   
#>  9 rear_nest_trt       mean           5.78 
#> 10 rear_nest_trt       sd             0.816
#> # ℹ 24 more rows
make_param_table(ManyEcoEvo::euc_data)
#> # A tibble: 74 × 3
#>    variable                parameter      value
#>    <chr>                   <chr>          <dbl>
#>  1 Quadrat no              mean            4.07
#>  2 Quadrat no              sd              2.37
#>  3 Easting                 mean       374341.  
#>  4 Easting                 sd          24426.  
#>  5 Northing                mean      5934936.  
#>  6 Northing                sd          39485.  
#>  7 ExoticAnnualGrass_cover mean           12.4 
#>  8 ExoticAnnualGrass_cover sd             15.3 
#>  9 ExoticAnnualHerb_cover  mean            7.89
#> 10 ExoticAnnualHerb_cover  sd             11.6 
#> # ℹ 64 more rows