I am interested in the statistical parameters of a power regression, i.e., a regression of the form $y=Ax^B$. In order to obtain the coefficients A and B, I am using the R function $\texttt{lm()}$ and the command $model=lm(\log(response.variable) \sim \log(predictor.variable))$. Then, the statistical parameters of the linear model are obtained as the output of the R function $\texttt{summary(model)}$. But I am interested in the statistical parameters of the power model. Therefore, I manually calculated the values of the residual sum of squares(RSS), the total sum of squares (TSS), the model sum of squares (MSS), the coefficient of determination ($R^2$), the residual standard deviation(or the residual standard error)(s) and the F ratio. These quantities are expressed by the following relationships:$$RSS=\sum_{i=1}^n (y_i-y'_i)^2$$ where $y_i$ is the vector of response variable and $y'_i$ are the fitted values obtained as the output of the command $\exp(\texttt{fitted(model)})$, $$TSS=\sum_{i=1}^n (y_i-mean(y_i))^2$$, $$MSS=TSS-RSS$$, $$R^2=1-\frac{RSS}{TSS}$$, $$s=\sqrt\frac{RSS}{n-p'}$$ where $n$ is the number of observations and $p'$ is the number of model parameters (i.e., the number of variables plus intercept), $$F=\frac{MSS/(p'-1)}{RSS/(n-p')}$$. (Is my approach correct ?). But I do not know how to calculate the values of the predictive error sum of squares (PRESS), the cross-validated $R^2$, i.e., $R_{cv}^2$ (or $Q^2$) and the standard deviation error in prediction (SDEP). How to compute the hat matrix in the case of power regression ? I found two R packages allowing computation of these predictive statistics in the case of linear models (i.e., the package MPV and qpcR). But how manually calculate these values for a power regression model where the fitted values are given by the command $\exp(\texttt{fitted(model)})$ ? If someone can provide the R code for these above mentioned statistics ?


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.