OBJECTIVES: Primary care high-risk prescribing causes significant harm, but it is unclear if it is largely driven by individuals (a 'bad apple' problem) or by practices having higher or lower risk prescribing cultures (a 'spoiled barrel' problem). The study aimed to examine the extent of variation in high-risk prescribing between individual prescribers and between the practices they work in.DESIGN, SETTING AND PARTICIPANTS: Multilevel logistic regression modelling of routine cross-sectional data from 38 Scottish general practices for 181 010 encounters between 398 general practitioners (GPs) and 26 539 patients particularly vulnerable to adverse drug events (ADEs) of non-steroidal anti-inflammatory drugs (NSAIDs) due to age, comorbidity or co-prescribing.OUTCOME MEASURE: Initiation of a new NSAID prescription in an encounter between GPs and eligible patients.RESULTS: A new high-risk NSAID was initiated in 1953 encounters (1.1% of encounters, 7.4% of patients). Older patients, those with more vulnerabilities to NSAID ADEs and those with polypharmacy were less likely to have a high-risk NSAID initiated, consistent with GPs generally recognising the risk of NSAIDs in eligible patients. Male GPs were more likely to initiate a high-risk NSAID than female GPs (OR 1.73, 95% CI 1.39 to 2.16). After accounting for patient characteristics, 4.2% (95% CI 2.1 to 8.3) of the variation in high-risk NSAID prescribing was attributable to variation between practices, and 14.2% (95% CI 11.4 to 17.3) to variation between GPs. Three practices had statistically higher than average high-risk prescribing, but only 15.7% of GPs with higher than average high-risk prescribing and 18.5% of patients receiving such a prescription were in these practices.CONCLUSIONS: There was much more variation in high-risk prescribing between GPs than between practices, and only targeting practices with higher than average rates will miss most high-risk NSAID prescribing. Primary care prescribing safety improvement should ideally target all practices, but encourage practices to consider and act on variation between prescribers in the practice.