It’s usually hard to quantify the quality of a movie, but in the case of “Doctor Sleep,” it’s easy: Precisely two-thirds of it is good.

A sequel to “The Shining,” “Doctor Sleep” incorporates elements of the Stanley Kubrick film “The Shining” — although writer Stephen King dislikes it — in telling the story of that movie’s main character. Danny was a child who had the ability to “shine,” to see into the past and communicate telepathically.

Danny is now Dan, an adult who inherited his father’s alcoholism and purposelessness.

As the film opens, Dan (Ewan McGregor) is visited by the ghost of his friend Hallorann (Scatman Crothers in “The Shining,” Carl Lumbly here), who advises that just as Hallorann helped young Danny, Dan eventually will be called upon to assist a youngster who has the shining.

Probably my favorite thing about “Doctor Sleep” is its structure, as classic as a triptych in the art world or the building of four movements within a symphony. “Doctor Sleep” has three central characters with three separate story lines that, pretty clearly, will come together in a finale set at a place that has special meaning for “The Shining” fans.

There’s Dan. There’s Abra (Kyliegh Curran), whose parents try to ignore her paranormal powers. And there’s Rose (Rebecca Ferguson), who masterminds a roving band of free-loving hippie vampires that travels the U.S. in search of children to torture so they can feast on their fear and pain.

The heavy involvement of children in “Doctor Sleep” sounds disturbing and it is, particularly since one of them is that nice Jacob Tremblay from “Room.” Folks who carry trauma from the mistreatment of children should be warned that “Doctor Sleep” could be a trigger. (And everyone should be warned that the movie contains an astonishing number of scenes of people blowing chunks.)

Of the three main characters, Dan and Abra are the first to meet, and their interaction provides “Doctor Sleep” with its heart. McGregor invests Dan with a deep well of pain, and after Dan begins going to AA meetings, it makes sense that he would reach out to assist Abra as she begins to have visions of children in torment. He is, after all, one of the few people in the world who has experienced what she’s going through. Newcomer Curran also is terrific, her Abra suggesting intriguing possibilities for “Doctor Sleep” sequels.

That brings us to the one-third of “Doctor Sleep” that doesn’t work: Rebecca Ferguson’s Rose. Ferguson, who made a splash with an amusing performance in “Mission: Impossible — Rogue Nation,” is adequate in a performance that should be a showy, spectacular avatar of evil. Essentially, the producers sent in a Rebecca Ferguson when what they needed was a Cate Blanchett, an Elisabeth Moss or, based on her work in “12 Years a Slave,” an Alfre Woodard.

As “Doctor Sleep” builds toward its climax, the “Shining” references begin to pile up: the thundery tones of its musical score, aerial shots of cars in the wilderness, that kind of thing. Those elements make “Doctor Sleep” unnerving, if never scary, but writer/director Mike Flanagan errs when he re-creates iconic shots from “The Shining” and asks Henry Thomas (yup, “E.T.’s” friend) to do an eyebrow-heavy impression of the inimitable Jack Nicholson.

It was always going to be a balancing act, figuring out how much of “The Shining” to repurpose in this sins-of-the-father sequel, but the closer “Doctor Sleep” gets to actually duplicating its predecessor, the more it reminds us that “The Shining” was a much better-made movie.