In cognitive radio wireless sensor networks (CRSN), the nodes act as secondary users. Therefore, they can access a channel whenever its primary user (PU) is absent. Thus, the nodes are assumed to be equipped with a spectrum sensing (SS) module to monitor the PU activity. In this manuscript, we focus on a clustered CRSN, where the cluster head (CH) performs SS, gathers the data, and sends it toward a central base station by adopting an ad hoc topology with in-network data aggregation (IDA) capability. In such networks, when the number of clusters increases, the consumed energy by the data transmission decreases, while the total consumed energy of SS increases, since more CHs need to perform SS before transmitting. The effect of IDA on CRSN performance is investigated in this manuscript. To select the best number of clusters, a study is derived aiming to extend the network lifespan, taking the SS requirements, the IDA effect, and the energy consumed by both SS and transmission into consideration. Furthermore, the collision rate between primary and secondary transmissions and the network latency are theoretically derived. Numerical results corroborate the efficiency of IDA to extend the network lifespan and minimize both the collision rate and the network latency.