ALL 95 residuals are 0: no residual degrees of freedom!

rdeaths <- lm(deathpop ~ tourism + GDP + obesity + malep + popd + elderlyp, data = covid19variables)
running this gives many results as N/A
Coefficients: (82 not defined because of singularities)
Estimate Std. Error t value Pr(>|t|)
(Intercept) -4.956e+00 NA NA NA
tourism1 945 919 2.006e-01 NA NA NA
tourism10 855 969 4.779e+00 NA NA NA
tourism1026000 7.441e+00 NA NA NA
tourism1041117 -3.879e+01 NA NA NA
tourism1072000 7.207e+00 NA NA NA
tourism10890500 -1.407e+00 NA NA NA
tourism10926000 -2.279e+01 NA NA NA
tourism11196000 7.674e+00 NA NA NA
tourism11817617 -2.481e+01 NA NA NA
tourism12045000 -3.013e-01 NA NA NA
tourism12749000 -1.610e+01 NA NA NA
tourism1364000 6.598e+00 NA NA NA
tourism1365000 7.223e+00 NA NA NA
tourism14000 6.468e+00 NA NA NA
tourism1402000 4.328e+00 NA NA NA
tourism142000 5.238e+00 NA NA NA
tourism14673000 -2.138e+01 NA NA NA
tourism15334000 -1.914e-01 NA NA NA
tourism15498000 2.762e+00 NA NA NA
tourism157000 5.843e+00 NA NA NA
tourism15810000 6.509e+00 NA NA NA
tourism1711000 6.412e+00 NA NA NA
tourism17174412 1.874e-01 NA NA NA
tourism17353488 2.385e+00 NA NA NA
tourism17423000 7.934e+00 NA NA NA
tourism1785000 4.400e+00 NA NA NA
tourism1819300 -1.734e+01 NA NA NA
tourism18780000 -1.154e+01 NA NA NA
tourism1964000 4.906e+00 NA NA NA
tourism21134000 -9.297e+00 NA NA NA
tourism21286000 -9.796e+00 NA NA NA
tourism2253429 -1.311e+00 NA NA NA
tourism2256000 -1.483e+00 NA NA NA
tourism2301000 3.348e+00 NA NA NA
tourism2473000 4.536e+00 NA NA NA
tourism25 038 500 -2.095e-01 NA NA NA
tourism2535000 8.261e+00 NA NA NA
tourism2580000 6.969e+00 NA NA NA
tourism25832000 1.467e+00 NA NA NA
tourism2599000 -4.588e+00 NA NA NA
tourism2657000 6.833e+00 NA NA NA
tourism2683748 4.655e+00 NA NA NA
tourism291000 6.722e+00 NA NA NA
tourism295000 5.683e+00 NA NA NA
tourism299000 2.431e+00 NA NA NA
tourism3 290 238 -1.180e+01 NA NA NA
tourism3017000 4.187e+00 NA NA NA
tourism31 883 731 -1.207e+01 NA NA NA
tourism31192000 -9.933e+00 NA NA NA
tourism3469000 5.770e-01 NA NA NA
tourism36316000 -6.714e+00 NA NA NA
tourism366700 7.614e+00 NA NA NA
tourism375000 2.761e-01 NA NA NA
tourism38 854 000 5.401e+00 NA NA NA
tourism38178000 1.437e+00 NA NA NA
tourism39 563 162 -1.019e+01 NA NA NA
tourism3904000 8.188e+00 NA NA NA
tourism4121000 -9.030e+00 NA NA NA
tourism41313000 6.937e+00 NA NA NA
tourism4150000 3.482e+00 NA NA NA
tourism427000 6.690e-01 NA NA NA
tourism4419000 8.779e+00 NA NA NA
tourism4425000 -2.017e+00 NA NA NA
tourism5070000 5.978e+00 NA NA NA
tourism5265000 5.646e+00 NA NA NA
tourism552000 8.364e+00 NA NA NA
tourism57000 6.945e+00 NA NA NA
tourism5723000 4.986e+00 NA NA NA
tourism5879307 -2.340e+01 NA NA NA
tourism6 168 576 1.942e+00 NA NA NA
tourism62900000 1.788e+00 NA NA NA
tourism65010220 -2.882e+00 NA NA NA
tourism6621000 7.590e+00 NA NA NA
tourism67728098 -1.269e+00 NA NA NA
tourism6800455 -8.136e+00 NA NA NA
tourism6942000 5.969e+00 NA NA NA
tourism7168000 6.974e+00 NA NA NA
tourism7295000 8.157e+00 NA NA NA
tourism7440000 -1.077e+01 NA NA NA
tourism7470546 2.227e+00 NA NA NA
tourism79745920 -1.665e+01 NA NA NA
tourism8299000 5.433e+00 NA NA NA
tourism836000 7.748e+00 NA NA NA
tourism849000 6.593e+00 NA NA NA
tourism8508000 -3.877e+00 NA NA NA
tourism871000 7.047e+00 NA NA NA
tourism892000 7.620e+00 NA NA NA
tourism89322000 -6.240e+00 NA NA NA
tourism897000 6.242e+00 NA NA NA
tourism9246000 -1.533e+01 NA NA NA
tourism932000 4.869e+00 NA NA NA
tourism966000 7.797e+00 NA NA NA
tourism99000 6.103e+00 NA NA NA
GDP 4.278e-04 NA NA NA
obesity0.10299999999999999 NA NA NA NA
obesity0.109 NA NA NA NA
obesity0.155 NA NA NA NA
obesity0.156 NA NA NA NA
obesity0.17100000000000001 NA NA NA NA
obesity0.186 NA NA NA NA
obesity0.19500000000000001 NA NA NA NA
obesity0.19700000000000001 NA NA NA NA
obesity0.19900000000000001 NA NA NA NA
obesity0.20100000000000001 NA NA NA NA
obesity0.20200000000000001 NA NA NA NA
obesity0.20399999999999999 NA NA NA NA
obesity0.20499999999999999 NA NA NA NA
obesity0.20599999999999999 NA NA NA NA
obesity0.20799999999999999 NA NA NA NA
obesity0.21199999999999999 NA NA NA NA
obesity0.215 NA NA NA NA
obesity0.216 NA NA NA NA
obesity0.221 NA NA NA NA
obesity0.222 NA NA NA NA
obesity0.223 NA NA NA NA
obesity0.22500000000000001 NA NA NA NA
obesity0.22600000000000001 NA NA NA NA
obesity0.22700000000000001 NA NA NA NA
obesity0.23100000000000001 NA NA NA NA
obesity0.23599999999999999 NA NA NA NA
obesity0.23799999999999999 NA NA NA NA
obesity0.24399999999999999 NA NA NA NA
obesity0.247 NA NA NA NA
obesity0.249 NA NA NA NA
obesity0.253 NA NA NA NA
obesity0.25600000000000001 NA NA NA NA
obesity0.25700000000000001 NA NA NA NA
obesity0.25800000000000001 NA NA NA NA
obesity0.26 NA NA NA NA
obesity0.26100000000000001 NA NA NA NA
obesity0.26300000000000001 NA NA NA NA
obesity0.26400000000000001 NA NA NA NA
obesity0.26900000000000002 NA NA NA NA
obesity0.27 NA NA NA NA
obesity0.27800000000000002 NA NA NA NA
obesity0.27900000000000003 NA NA NA NA
obesity0.28000000000000003 NA NA NA NA
obesity0.28299999999999997 NA NA NA NA
obesity0.28899999999999998 NA NA NA NA
obesity0.28999999999999998 NA NA NA NA
obesity0.29399999999999998 NA NA NA NA
obesity0.29799999999999999 NA NA NA NA
obesity0.30399999999999999 NA NA NA NA
obesity0.308 NA NA NA NA
obesity0.317 NA NA NA NA
obesity0.32 NA NA NA NA
obesity0.32100000000000001 NA NA NA NA
obesity0.32500000000000001 NA NA NA NA
obesity0.33700000000000002 NA NA NA NA
obesity0.35099999999999998 NA NA NA NA
obesity0.35399999999999998 NA NA NA NA
obesity0.35499999999999998 NA NA NA NA
obesity0.36199999999999999 NA NA NA NA
obesity0.379 NA NA NA NA
obesity2.1000000000000001E-2 NA NA NA NA
obesity27.4% NA NA NA NA
obesity3.5999999999999997E-2 NA NA NA NA
obesity3.9E-2 NA NA NA NA
obesity4.2999999999999997E-2 NA NA NA NA
obesity4.4999999999999998E-2 NA NA NA NA
obesity5.2999999999999999E-2 NA NA NA NA
obesity5.3999999999999999E-2 NA NA NA NA
obesity5.5E-2 NA NA NA NA
obesity5.8000000000000003E-2 NA NA NA NA
obesity6.0999999999999999E-2 NA NA NA NA
obesity6.2E-2 NA NA NA NA
obesity6.4000000000000001E-2 NA NA NA NA
obesity6.9000000000000006E-2 NA NA NA NA
obesity7.0999999999999994E-2 NA NA NA NA
obesity7.6999999999999999E-2 NA NA NA NA
obesity8.1000000000000003E-2 NA NA NA NA
obesity8.5999999999999993E-2 NA NA NA NA
obesity8.6999999999999994E-2 NA NA NA NA
obesity8.7999999999999995E-2 NA NA NA NA
obesity8.8999999999999996E-2 NA NA NA NA
obesity9.6000000000000002E-2 NA NA NA NA

Residual standard error: NaN on 0 degrees of freedom
(18 observations deleted due to missingness)
Multiple R-squared: 1, Adjusted R-squared: NaN
F-statistic: NaN on 94 and 0 DF, p-value: NA

Hello and welcome!

Zero degrees of freedom means that you have to many variables for the amount of rows you have.

Can you paste they output of str(covid19variables)?

So we can understand your data better. Or you can use dput() if your data is small.

str(covid19variables)
tibble [113 x 9] (S3: tbl_df/tbl/data.frame)
Code : chr [1:113] "BDI" "VNM" "TZA" "UGA" ... Country : chr [1:113] "Burundi" "Vietnam" "Tanzania" "Uganda" ...
ln_death_pop : num [1:113] -2.414 -1.033 -0.986 -0.289 -0.249 ... ImportedTourism: chr [1:113] "299000" "15498000" "1378000" "1402000" ...
GDPperCapita : num [1:113] 261 2715 1122 794 504 ... ObesityLevel : chr [1:113] "5.3999999999999999E-2" "2.1000000000000001E-2" NA "5.2999999999999999E-2" ...
MalePop : num [1:113] 5719 48151 28981 21807 14746 ... PopDens : num [1:113] 435.2 308.1 63.6 213.1 37.5 ...
$ ElderlyPop : num [1:113] 266598 7286432 NA 868813 874070 ...

I have a suspicion that your variables are being treated as factors, when you want them to simply be numeric. As a result you are getting more variables than observations.

@startz is right and could be that you have characters in your data such as the example above, E-2.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.