CalcR2: Calculates R2 of a numerical variable using date as the...

Description Usage Arguments Value License See Also

View source: R/plots_order.R


Calculates weighted R2 of a univariate weighted linear model with dateNm as x and myVar as y using the workhorse and lm.wfit functions.


CalcR2(myVar, dataFl, dateNm, weightNm = NULL, imputeValue = NULL)



Name of variable to model.


A data.table, containing myVar, dateNm, and weightNm.


Name of column containing the date variable (to be modeled as numeric); this date column must not have NA's.


Name of column containing row weights. If weights equal one, then the function will be called, otherwise the lm.wfit will be called. The weights column must not have NA's.


Either NULL or numeric. If NULL, model will be fit on only non-NA components of myVar. If numeric, missing cases of myVar will be imputed to imputeValue.


A numeric value of R2.


Copyright 2017 Capital One Services, LLC Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

See Also

Functions depend on this function: OrderByR2.

This function depends on: PrepData.

otvPlots documentation built on May 1, 2019, 6:49 p.m.