good evening

I hope that you are all in good health.

The dataset comprises of a balanced panel of eight Australian states

I am using a dataset that comprises of a balanced panel of 45 countries. I have run a convergence test (following the methodology developed by Phillips and Sul, 2007 and 2009) and ended up founding 3 clubs. Now, I would like to investigate the factors that explain why countries in each club converge. I have seen that in order for me to do that, I first need to find the average values of each independent variable for each club. My dependent variable is public health expenditure per capita (lPUBLX). To determine the average values, I have used the following command:

collapse (mean) dpnd dpnG65 dpnL15 urb ext odagdp ggegdp pubthe privthe activlab activfe pheGE dnst unemp TB HIVprev Auto Demo primedu secedu tertedu soseghe compol popL15 popG65, by (lPUBLX year)
but it is not working and I got the following message from stata
type mismatch
r(109);

I clicked on the r(109)
and it gives me the following message:
error . . . . . . . . . . . . . . . . . . . . . . . . Return code 109
type mismatch
In an expression, you attempted to combine a string and numeric
subexpression in a logically impossible way. For instance, you
attempted to subtract a string from a number or you attempted
to take the substring of a number.

I then typed describe to understand what the problem is, but it shows that two variables popL15 popG65 (percentage of population under 15 and percentage of population over 65 are string variables) which i removed, but still i get the same error message.

is there anything wrong with the code I used? Is it the appropriate code to use in such a case? If not, then how should I proceed?

Your assistance will be highly appreciated

Regards