The head or brain, as in He's not all there in the upper story. This expression transfers the literal sense of a higher floor in a multistory building to the top portion of the human body. Richard Bentley used it in A Dissertation on the Epistles of Phalaris (1699), where he compares a man with “brains ... in his head” to a man who has “furniture in his upper story.”
Examples from the Web for upper story
From the upper-story windows, where he had climbed, he could see to the edge of the forest.Lorraine
Robert W. Chambers
Still he was a pleasant giant (particularly to the upper-story boy), and welcome to the whole company.The Art of Amusing
How I reached the upper-story, I know not; but, on waking late in the day, I found my pocket-book was absent—without leave.The True History of Tom and Jerry
The "Diggers" retaliated mildly by styling their upper-story neighbors, "Camanches."
From an upper-story window, without a sash, the figure of Tom leans out in an inquisitive attitude.