Units of average-Is it units of $y$ or units of $y/x$ Imagine we have a collection of 10 heights of individuals in feet.
We calculate the average value as:
$$
\mu=\frac{1}{10}\sum_{i=1}^{10}h_{i}
$$
where $h_{i}$ is the height of an individual $i.$ In this case,
is the average $\mu$ in units of feet, or units of feet/individual?
From economics, the average cost of producing $q$ units is given
as:
$$
AC\left(q\right)=\frac{TC\left(q\right)}{q}
$$
where $TC$ is total cost for producing $q$ units, $AC$ is average
cost, and $q$ is total quantity. Here, the average cost is in units
of say \$/unit of output. My question: in which circumstances are
the units of height in units of the variable being measured- say $y,$
and in which are they two dimensional, say $y$ per $x$ (like cost
per unit, or average speed per hour)? Does it matter?
 A: Compare:
   ✔    “The average height of the students is $178.3\textrm{ cm}.$”
   ✗    “The average height of the students is $178.3\textrm{ cm}\text{/student}.$”
   ✔    “The average production cost of the units is $\$459.$”
   ✗    “TThe average production cost of the units is $\$459\text{/unit}.$”
   ✔    “The average speed of the car for journey A is $75.1\textrm{ km h}^{-1}.$”
   ✗    “The average speed of the car for journey A is $75.1\textrm{ km h}^{-1}\textrm{/h}.$”
   ✔    “The average number of goals among the teams is $13.4.$”
   ✗    “The average number of goals among the teams is $13.4\text{ goals/team}.$”
Average height is after all still a height, and makes sense to have exactly the same dimension as individual height.  That we are referring to student heights (as opposed to tree heights) belongs to the context, rather than to the quantity's specification per se.
The third example makes this even clearer: surely the average speed doesn't have units $75.1\textrm{ km h}^{-2},$ which is that of acceleration!
In the same vein:
   ✔    “The number of goals scored by the team is $7.$”
   ✗    “The number of goals scored by the team is $7\text{ goals}.$”

The gradient of a displacement-time graph is instantaneous velocity—not average displacement nor average velocity —so has units $$\textrm{km h}^{-1}$$ instead of merely $$\textrm{km}.$$

In the graph of Total Production Cost $(TC)$ against Quantity $(q),$ the gradient is Marginal Cost $(MC),$ not Average Production Cost $(AC),$ which is just $\displaystyle\frac{TC(q)}q.$
$TC, MC,$ and $AC$ all have unit $$\$.$$
