In my panel data (firm-year), I was able to calculate the row mean using
egen RowMean=rmean(Var1 Var2 Var3) if !missing(Var1) & !missing(Var2) & !missing(Var3)

How about the row median (at the firm-year level)?