It could bad connection or the connection isn't seeded properly. Believe it or not, it could actually be a virus. Had a buddy with similar problem... He thought the touchscreen was broken. I took it apart and it was fine. I started rebooting it multiple times in a row and eventually the touchscreen started to work a little. Downloaded antivirus, closed a zillion apps that were all in recents, and closed 81 tabs on the browser. Now it works well. I think the virus and everything running made it lag so bad that by the time the touchscreen registered the touch, the screen had already timed out.
Best advice I could give you is to do a factory reset from recovery. (Try to backup what you can first.) After that if no touchscreen, I would assume it's a connection problem or you need to replace it.