This is actually pretty simple, and I see it all the time in my 'Who's Viewed Your Profile' area. It's strange, but I think we all view the words "This member chose to be shown as anonymous" with a degree of suspicion and annoyance, but people do it for a variety of reasons. While it does niggle me that I pay to see who'd been looking at my profile and this is easily circumnavigated, I do see why some folks (especially recruiters and researchers working via their private profiles) might want the benefits of a little smoke and mirrors.
nothing to see here - just passing through
Anonymity isn't natural for social channels. Visibility and transparency drive ad revenue and promote engagement. As a consequence, the ability to do things like this are often hidden away and not as easy to find as we might like. As such, you'll not find this information easily unless you go looking for it:
Select 'Privacy & Settings' from the drop down under your thumbnail profile picture (upper right corner), to get to your settings page.
Under 'Privacy Controls' there are a few interesting options worth exploring, but the one we're looking for in this instance is 'Select what others see when you're viewing their profile'. You'll then get 3 options like those in the pop-up below.
Pick an option - normal, enigmatic, or full on spy - and save.
Bear in mind, this is your settings from now on. If you want this to go back to how it was you'll need to reset this using the same process as last time. Remember, LinkedIn is about connections. Keeping your profile like this, long-term, kinda defeats the object.