I'm trying to use the glm() command in R on my dataset (data_2, see below). I use the following command:
glm(formula = GRM_KerkMeerlo ~ ((fGS*0.865 + fQS*EC_QS + fXS*EC_fXS)/Q), data = data_2)
I thought that I was doing the right thing, but when I run this input I get an error:
Error in terms.formula(formula, data = data) : invalid model formula in ExtractVars
I've looked all over this website to find out what I did wrong but without result, so here I am, asking what on Earth I have done wrong.
I think I've made just a little mistake that can be solved easily, I just can't see what.
Thank you!
data_2
date P ETpot Q T fXS GRM_KerkMeerlo GRM_SintJorisweg fGS
fQS
1 2016032400 0 0.000 0.00816 4.0 0.00431 0.49775 0.45550 NA NA
2 2016032401 0 0.000 0.00814 4.6 0.00431 0.49675 0.45675 0.0022 0.0022
3 2016032402 0 0.000 0.00816 5.2 0.00431 0.49725 0.45600 0.0022 0.0021
4 2016032403 0 0.000 0.00812 5.3 0.00431 0.49600 0.45625 0.0021 0.0021
5 2016032404 0 0.000 0.00809 5.5 0.00431 0.49550 0.45525 0.0021 0.0020
6 2016032405 0 0.001 0.00812 6.5 0.00431 0.49525 0.45425 0.0021 0.0020
7 2016032406 0 0.009 0.00807 6.9 0.00431 0.49575 0.45550 0.0021 0.0019
8 2016032407 0 0.018 0.00803 7.0 0.00431 0.49600 0.45400 0.0021 0.0019
9 2016032408 0 0.032 0.00801 7.4 0.00431 0.49700 0.45175 0.0021 0.0019
10 2016032409 0 0.060 0.00801 8.3 0.00431 0.49800 0.45050 0.0021 0.0018
11 2016032410 0 0.066 0.00788 8.7 0.00431 0.49825 0.45100 0.0021 0.0018
12 2016032411 0 0.088 0.00799 9.5 0.00431 0.49850 0.45075 0.0021 0.0018
13 2016032412 0 0.102 0.00797 9.6 0.00431 0.50200 0.45025 0.0021 0.0017
14 2016032413 0 0.077 0.00805 9.9 0.00431 0.50150 0.45000 0.0021 0.0017
15 2016032414 0 0.074 0.00801 9.9 0.00431 0.50075 0.44775 0.0021 0.0017
16 2016032415 0 0.053 0.00803 9.7 0.00431 0.50150 0.44825 0.0021 0.0016
17 2016032416 0 0.018 0.00799 9.4 0.00431 0.50050 0.44725 0.0021 0.0016
18 2016032417 0 0.003 0.00803 8.8 0.00431 0.49975 0.45000 0.0021 0.0016
19 2016032418 0 0.000 0.00793 8.1 0.00431 0.49925 0.45025 0.0021 0.0015
20 2016032419 0 0.000 0.00791 8.1 0.00431 0.49825 0.44600 0.0021 0.0015
21 2016032420 0 0.000 0.00797 8.1 0.00431 0.49875 0.44475 0.0021 0.0015
22 2016032421 0 0.000 0.00791 7.3 0.00431 0.50100 0.44300 0.0021 0.0014
23 2016032422 0 0.000 0.00784 7.0 0.00431 0.50100 0.44125 0.0021 0.0014
24 2016032423 0 0.000 0.00795 7.6 0.00431 0.50050 0.44050 0.0021 0.0014
25 2016032500 0 0.000 0.00791 7.6 0.00374 0.50075 0.43975 0.0021 0.0013