The calculation is described in the "USCF Chess Rule Book", chapter 34E1,
34E1. Modified Median
The Median system, also known as the Harkness system for inventor Kenneth Harkness, evaluates the strength of a player’s opposition by summing the final scores of his or her opponents and then discarding the highest and lowest of these scores.
In the Modified Median system, players who tie with even scores (an even score is equal to exactly one half of the maximum possible score), have the highest- and lowest-scoring opponents’ scores excluded. The system is modified for players with non-even scores to disregard only the least significant opponents’ scores: the lowest-scoring opponent’s score is discarded for tied players with plus scores and the highest-scoring for tied players with minus scores.
For tournaments of nine or more rounds, the top two and bottom two scores are discarded for even-score ties, the bottom two scores for plus-score ties, and the top two scores for minus-score ties.
These scores are adjusted for unplayed games, which count a half point each, regardless of whether they were byes, forfeits, or simply rounds not played after an opponent withdrew. So an opponent who won the first two games, lost the third, withdrew and did not play rounds four or five would have an adjusted score of 3 points (1+1+0+0.5+0.5 = 3). These adjusted scores are used only to calculate the opponent’s tiebreaks. The player’s own score is not changed.
If the player involved in the tie has any unplayed games, they count as opponents with adjusted scores of 0.
What is unclear to me is the term: the least significant opponents’ scores. Does this include a Bye, which is a score without an actual opponent. Or is the Bye excluded from the modification procedure?
I find the text ambiguous and open to multiple interpretations, as in the answers below. Therefore, I would like to see how the calculations are performed in actual USCF tournaments.
Update-2
A cross table including the four USCF tie-breaks can be found here 2007, 128th (=129th) Annual New York State Championship. From this cross table one can conclude the unplayed games are part of the deletion process.
Update-1
Consider the 2022 US Open Championship, 30 July - 7 August, 2022· Rancho Mirage CA.
Are the default US Chess tiebreakers applied? Why is Aleksey Sorokin champion?
No. Name St Rate Pts Rnd1 Rnd2 Rnd3 Rnd4 Rnd5 Rnd6 Rnd7 Rnd8 Rnd9
1 SOROKIN, ALEKSEY TX 2648 8.0 W193 W125 W 65 W 36 W 3 D 15 D 17 W 7 W 9
2 MORADIABADI, ELSHAN NC 2614 8.0 W370 W269 W 78 W 46 W 81 W 14 D 5 D 9 W 15
3 JACOBSON, BRANDON NJ 2626 7.5 W281 W124 W 68 W 37 L 1 W157 W 39 D 5 W 17
4 EIDELMAN, GABRIEL CA 2249 7.5 W272 W 84 W 85 L 10 W112 D 12 W 81 W 35 W 32
5 NARODITSKY, DANIEL A NC 2699 7.0 W135 W 73 W 41 W 19 W 33 D 17 D 2 D 3 D 10
6 AKOBIAN, VARUZHAN MO 2655 7.0 W277 W123 W 64 D 18 D 8 W 37 W 38 D 17 D 12
7 SHABALOV, ALEXANDER PA 2607 7.0 W138 W 51 W 42 W 22 D 16 D 39 W 61 L 1 W 38
8 Hong, Andrew CA 2604 7.0 W235 W 31 W216 W212 D 6 L 9 W108 W 24 -H-
9 MATVIISHEN, VIKTOR TX 2558 7.0 W152 W126 W 70 D 15 W 72 W 8 W 16 D 2 L 1
10 SHENG, JOSHUA CA 2558 7.0 W 97 W217 W 27 W 4 L 17 D 16 W 44 W 25 D 5
11 SCHMAKEL, SAMUEL ARTHUR IL 2504 7.0 W140 D 76 W175 D 39 W 45 W 22 W 46 L 15 W 42
12 COSTELLO, ALEXANDER JOHN CA 2379 7.0 W271 W 83 W 28 L 17 W213 D 4 W 48 W 52 D 6
13 MELIKIAN, GNEL CA 2338 7.0 W 99 W167 D317 D213 W214 D 26 D 28 W 46 W 57
14 MEI, AUSTIN R CA 2265 7.0 -X- W 57 W218 D 47 W 50 L 2 W 76 D 33 W 34