I need to create a new variable in my dataset. I need to find the logarithm of other variable.
My dataset is gdp per year (2016-2021) for columns and countries for rows.
I have find this equation (dataset4$log_GDP<- log(dataset4$gdp_2016, dataset4$gdp_2017, dataset4$gdp_2018, dataset4$gdp_2019, dataset4$gdp_2020, dataset4$gdp_2021)) which allows me to create a new variable (log_gdp) in my dataset but the fact is that i have the same response for each country (12.25947) so that my last column (log_gdp) is only filled with 12.25947.
Do you know how to resolve it and having a different log_gdp for each country ?