A staying state analysis device for measuring a stay frequency of moving objects in a target area and generating a heat map visualizing a state of distribution of the stay frequency for display on a display device, the staying state analysis device comprising: a position information sorting unit that sorts pieces of position information of the moving objects obtained from a moving object detection device in accordance with a degree of possibility that the pieces of position information may include an error due to a missing part that may be created in traffic lines of the moving objects; a missing part position detection unit that detects a position of the missing part in the traffic lines based on at least two groups of pieces of position information sorted by the position information sorting unit; a corrected distribution information generation unit that generates corrected distribution information representing the stay frequency of the moving objects corrected based on a result of detection by the missing part position detection unit; and a heat map generation unit that generates the heat map based on the corrected distribution information generated by the corrected distribution information generation unit, characterized by further comprising a distribution information comparison unit that generates two sets of distribution information for comparison, each representing a state of distribution of the stay frequency of the moving objects, respectively from the two groups of pieces of position information sorted by the position information sorting unit, and compares the two sets of distribution information for comparison with each other, wherein the distribution information comparison unit generates differential distribution information which is a difference between the two sets of distribution information for comparison, and wherein the missing part position detection unit detects the position of the missing part in the traffic lines based on the differential distribution information. a position information sorting unit that sorts pieces of position information of the moving objects obtained from a moving object detection device in accordance with a degree of possibility that the pieces of position information may include an error due to a missing part that may be created in traffic lines of the moving objects; a missing part position detection unit that detects a position of the missing part in the traffic lines based on at least two groups of pieces of position information sorted by the position information sorting unit; a corrected distribution information generation unit that generates corrected distribution information representing the stay frequency of the moving objects corrected based on a result of detection by the missing part position detection unit; and a heat map generation unit that generates the heat map based on the corrected distribution information generated by the corrected distribution information generation unit, characterized by further comprising a distribution information comparison unit that generates two sets of distribution information for comparison, each representing a state of distribution of the stay frequency of the moving objects, respectively from the two groups of pieces of position information sorted by the position information sorting unit, and compares the two sets of distribution information for comparison with each other, wherein the distribution information comparison unit generates differential distribution information which is a difference between the two sets of distribution information for comparison, and wherein the missing part position detection unit detects the position of the missing part in the traffic lines based on the differential distribution information.