How to disabled Statistics module for role or anonym users? I use Statistics module (Drupal core modules) on my site to get node's view count. How to disabled this function for role or anonym users?

Like that in template.php:

function MYTHEME_preprocess_page(&amp;$vars) {
  if (!$logged_in) {
    // Code for disable Statistics module
  }
}
The statistics module doesn't provide that option, or an easy way to inject that logic at first glance.

If you're using the AJAX counting method, you can implement hook_js_alter() to change the settings that the module adds, specifically altering the path it sends the tracking AJAX request to. You can change that to a file controlled by your own module, and you can make the decision whether or not to save the record based on the current user in there (after copying the code from the stats module's own statistics.php file).

If you're not using the AJAX method, there are a few different ways you could attack it, but each are more of a pain than it's probably worth. If the AJAX version isn't an option, I'd recommend writing your own custom module that incorporates the existing logic from Statistics that you need, plus your new logic.

The other options are doing things like trying to remove the Stats module's implementations of hook_exit() and/or hook_node_view() from your own module, and re-implementing them. This is never a great approach as you have to re-visit your module every time there's a core update to make sure nothing's changed.

Or, you could maintain a patch to the core module. Usual caveats apply if you go down that route obviously.