Analysis of Mobility Changes Caused by COVID-19 in a Context of Moderate Restrictions Using Data Collected by Mobile Devices

Since its inception, COVID-19 has changed several dynamics in society, both on a personal and professional level. Mobility was one of the most affected aspects, as a result of the necessary social distancing and preventive measures that had to be enacted by the various countries and which restricted, at various times, freedom of movement. The impact that COVID-19 had, and still has, on mobility is important to be understood so that the necessary measures can be taken in order to return to normality and, for example, not regress in the steps that were being taken in encouraging the use of public transport as a measure to combat the carbon footprint as well as traffic congestion in cities. This paper intends to analyze the reality of Spain and Portugal, in the period between May 10th and July 2nd, 2021, in which both countries had already finished restricting mobility measures. The study used data from Google Community Mobility Reports and was done by regions, taking into account the average age of inhabitants and the number of inhabitants in each region. The analysis focused on different categories of places such as retail and recreation, groceries and pharmacies, parks, transit stations, workplaces, and residential. One of the main conclusions of this study is the lower use of public transports for fear of a greater risk of infection. This could be a problem in the medium term if this trend continues. On the other hand, it is important to highlight a greater presence in parks after the end of the lockdown, which promotes healthy habits that combat problems such as overweight or obesity. COVID-19 can be seen as an opportunity to promote more active mobility through the creation of infrastructure, such as for bicycles.


I. INTRODUCTION
COVID-19 first emerged in Hubei province, in China, after a cluster of viral pneumonia cases of unknown cause [1], [2]. Given the high levels of contagion and seriousness of the cases detected so far, the World Health Organization (WHO) declared, on March 11, 2020, COVID-19 as a pandemic [3]. Ensuring a minimum distance between people and minimizing communication between people from different communities became necessary [4], [5].
As of September 7, 2021, there were approximately 220 million confirmed cases worldwide and approximately 4.5 million deaths from COVID-19 [6]. Since the beginning of the pandemic, and considering the European continent, The associate editor coordinating the review of this manuscript and approving it for publication was Nikhil Padhi . there has been a very strong impact in Italy, which became the first country to report cases in mid-February. At the end of the month, cases also started to appear in other European countries such as Spain or Portugal.
From the moment WHO declared COVID-19 to be a pandemic, restrictive measures began to be imposed around the world, impacting various sectors of society: commerce, health, education, public services, among others [7], [8].
Consequently, and inevitably, the mobility of citizens was severely affected [9], [10]. Some of the measures taken by municipalities and governments included reducing the capacity of transport services such as buses, subways, and trains to a maximum capacity of 50%, closing buildings and public services, and global limitations on mobility of people who were advised to leave the home only for essential matters such as purchasing food, health related issues or to go to work [11]- [13].
The main contribution of this work is to identify the impact of two factors -average age of inhabitants and number of inhabitants -on the mobility of citizens both in Portugal and Spain, in the period between 10 May and July 2nd, where no mobility restrictions existed in any of two the countries.
The rest of the paper is organized as follows. The next chapter starts by introducing related work. Chapter III introduces the methodology in terms of data characterization and statistical analysis. Chapter IV presents the results of the analysis carried out, organized by country (Spain and Portugal) and by type (average age and number of inhabitants). Chapter V presents the discussion of the results and chapter VI presents the conclusions.

II. RELATED WORKS
Several studies have been developed focused on the relations between citizen mobility and COVID-19, whether in terms of the ease of transmission of the virus, in evaluating the effectiveness of government measures that affected mobility or in the impact that COVID-19 had on mobility. One of such studies combined the mobility index and new case time series for 80 of the most affected cities in China from Jan 17 to Feb 29, 2020 with the purpose to quantify the time-lag effect and therefore evaluate its influencing socio-demographic and environmental factors [8].
Human mobility patterns during this period have in many studies relied on the processing of data obtained from mobile devices. Google Community Mobility reports was used, namely data from 26 districts in Tamilnadu were considered for a study conducted [14] to analyse mobile patterns using Fuzzy C-Means clustering. Anonymized mobile phone data was also used in another study in Austria [13] where the authors assess the effect of the lock-down quantitatively for all regions and present an analysis of daily changes of human mobility throughout Austria. In [15], the relationships between containment and closure policies, disease trends, and human mobility patterns in 40 countries in Western, Eastern, Northern, and Southern Europe and North America is explored. Finally, in Rio de Janeiro, network usage data was analysed and compared from pre-lockdown, during lockdown, and post-lockdown phases to understand human mobility patterns during the pandemic, and to evaluate the effect of lockdowns on mobility.
The need to analyze data and present information quickly, efficiently and intuitively also motivated another set of studies. Examples are a digital platform based in a multi-agent system to plot the different mobility alternatives to counteract the agglomerations in public transport was proposed in [16] and a visual analytic tool that facilitates the investigation of COVID-19 data including time series daily reports and mobility trends [17].
Some of the latest studies in Spain and Portugal are presented next, as this paper specifically focuses on these two countries.
In [11], authors assess the impact of mobility on epidemic spreading in order to conclude on the effects of the measures taken by government entities to restrict the mobility of citizens in Spain. Specifically, the authors refer to the multi-seeding factor that occurs when several independent individuals (non-clustered) come across a susceptible population, which can enhance autonomous outbreaks. The study is carried out in 52 provinces of Spain, showing that local outbreaks of incidence and mortality are strongly correlated with mobility occurring in the early-stage weeks from and to Madrid, the main mobility hub and where the initial local out-break unfolded.
In [18], authors make use of various private mobility data collected essentially from the smartphones of Spanish citizens. As private data, they focus more on the movement of individuals and not on the means of transport, thus ensuring the representation of a large portion of society. The study illustrates how a direct comparison of different sources can be misleading, as certain days (e.g., Sundays) exhibit a directly adverse behavior. After understanding the different particularities, the authors concluded that there is a partial and complementary correlation under proper interpretation. They also concluded that mobile data can be used to assess the effectiveness of implemented government policies as well as detecting changes in mobility trends.
The impact of the containment and quarantine measures imposed in the city of Santander on March 15, 2020, in Spain, were studied in [19]. The data used was collected from traffic counters, traffic cameras, public transport and environmental sensors in order to make comparisons between journey flows and times before and during the confinement, which allowed for an initial diagnosis of how mobility has reduced and how the modal distribution and journey purposes have changed. The main results pointed to an overall reduction in mobility of 76%, not being so notorious in the case of private vehicles. Public transport users were reduced by 93%, NO2 emissions were reduced by up to 60%, and traffic accidents were reduced by up to 67%.
Data from Google COVID-19 Community Mobility Reports was used in [20] to measure the effectiveness of distance measures imposed in Portugal during the COVID-19 pandemic. The study allowed us to conclude that the imposed mobility measures allowed the reduction of Rt from 3 to 1 in a period of 25 days. The most affected form of mobility was the use of public transport, with a greater use of private vehicles, with a view to reducing environments with large crowds of people. The authors emphasize the importance of promoting active mobility, as a way to combat possible pandemic situations that may happen in the future, but that a cultural change is required so that this can become a reality in the future. Another conclusion of the study shows the great affluence to parks when the alleviation of mobility restriction measures were verified, reflecting the importance of these places in the mental health of citizens.
In [21], authors present a study that used a tracking infrastructure in order to understand human mobility during the VOLUME 10, 2022 COVID-19 outbreak, in order to contrast its diffusion. The infrastructure was deployed at 81 Points-of-Interests (POIs) on Madeira Island, Portugal, in order to collect massive amount of spatio-temporal data, supplemented with statistical data on infected people as well as crowd sourced data collected from citizens. The objective of the implemented infrastructure was 1) to provide stakeholders with a visual tool that would allow to contrast COVID-19 diffusion through human mobility monitoring and 2) to give more precise information to citizens about the number of people gathered in a given POI so citizens can plan their day more safely and avoid large crowds of people. The study presents the infrastructure and application of interactive data visualization that the authors concluded to be adequate to provide citizens with the necessary information about the flow of people during the COVID-19 outbreak and illustrates the changes in the mobility patterns of the island.
In general terms, COVID-19 has led to several significant changes in road conditions and drivers' behavior in transportation network. The impact observed on these variables during the pandemic was sudden and, in many cases, unpredictable [22]. The main changes were noticed on the values of traffic volume on the road and also on the street network. In [22], the authors present road traffic volume analysis in cities before and during the restrictions related to COVID-19. With the purpose to characterize the daily, weekly and annual variability of traffic volume in 2019 and 2020 and also to estimate daily traffic patterns at particular stages of the pandemic, selected traffic characteristics were compared for 2019 and 2020.
There are other studies in which other sociodemographic and environmental aspects related with COVID-19 have been analysed. For instance, [23] analyses the impact of the virus on the population depending on their urban living environment. They use data gathered in Wuhan, China, and they conclude that infection ratios are primarily affected by the number of buildings and the density of the population, followed by the characteristics of the surrounding environment.
In Spain, on May 9 at 00:00 the third state of alarm ended. This meant that the curfew between 23:00 and 6:00 ceased to be in force. The restrictions on mobility between regions and the limitation on the number of people at indoor and outdoor gatherings also disappeared. However, other types of measures have remained, mainly focused on time restrictions in the restaurants and nightlife [24]. On May 1st, the state of emergency in Portugal ended and, with it, the closing of the land borders with Spain. Mobility restrictions ended up maintaining, similarly to what happened in Spain, some restrictions on the hours of some establishments as well as maximum capacity in some events.

A. DATA CHARACTERIZATION
The data used to perform the analysis presented in this article comes from Google Community Mobility Reports [25], initially created to support critical decisions to combat COVID-19, based on a process of data aggregation and anonymization described in [26]. This report presents movement trends over time by geography chart, across different categories of places such as retail and recreation, groceries and pharmacies, parks, transit stations, workplaces, and residential, which favors the analysis of the impact of COVID-19 on the mobility of citizens.
The data show how the number of visitors changes at the categorized places compared to the reference days. The reference day is the average number of visitors between January 3 and February 6, 2020 considering the day of the week.

B. STATISTICAL ANALYSIS
ANOVA tests were conducted in order to determine if there are significant differences between the groups, in each country, taking into account the average of the inhabitants and the number of inhabitants. This method is used because the sample size allows to consider the normal approximation as good. Tukey's HSD tests were employed to compare means found different using analysis of variance. A significance level of p < 0.05 is fixed for all statistical tests. The groups analyzed in each country were constructed using cluster analysis. This statistical technique classifies elements into groups, so that elements within the same cluster are very similar, and elements in different clusters are distinct from each other. In general, groups must satisfy the criteria of homogeneity, internal cohesion, isolation of groups and heterogeneity between groups, which guide the formation of clusters. Among the various grouping methods, the k-means method was chosen because it uses the initial data matrix and, generally speaking, it consists of transferring an individual to the cluster whose centroid (group center) has a shorter distance from it. Statistical analysis was performed using IBM SPSS v25. Table 6 shows how all regions from Spain were included in each group according to the average age of their inhabitants. Figure 1 captures the percentage that mobility has increased or decreased after the state of alarm in Spain compared to the baseline and grouped by the mean age of the inhabitants. In the case of retail and recreation areas the difference between the three groups is not significant [F(2, 1023) = 0.275; p = 0.760]. Moreover, mobility in these locations is lower than baseline.

A. MOBILITY ACCORDING TO AVERAGE AGE OF THE INHABITANS IN SPAIN
In groceries and pharmacies, there are significant differences between the groups [F(2, 981) = 106.898; p < 0.05]. Group A, composed by the regions with the lowest mean age, exhibits the lowest mobility in these places, while group C presents the highest. Post hoc comparisons using the Tukey HSD test indicates that the mean value for group A (M = −5.12, SD = 7.84) is significantly different than the Group B    Table 2 shows the regions included in each group. Figure 2 captures the percentage that mobility has increased or decreased after the state of alarm in Spain compared to the baseline and according to the number of inhabitants. We can observe that there are no significant differences between the groups in the retail and recreation areas F(2, 1023) = 1.094; p = 0.335]. Moreover, mobility in these locations remains lower than the baseline.
Considering mobility in groceries and pharmacies is higher compared to the baseline in all regions. In addition, there are significant differences between the groups [F(2, 981) = 3.322; p < 0.05]. Post hoc comparisons using the Tukey HSD test indicates that the mean value for group A  Finally, in all regions, the presence in residential areas has increased. In addition, there are significant differences between the groups [F(2, 1009) = 11.288; p < 0.05]. Post hoc comparisons using the Tukey HSD test indicates that the mean value for group B(2.53, SD = 3.26) is significantly different than the group A (M = 1.04, SD = 2.41) and group C (1.36, SD = 3.07). No other differences are statistically significant. Table 3 shows the regions included in each group according to the average age of inhabitants in Portugal. Figure 3 captures the percentage that mobility has increased or decreased after the state of alarm in Portugal compared to the baseline and grouped by the mean age of the inhabitants.

C. MOBILITY ACCORDING TO AVERAGE AGE OF THE INHABITANTS IN PORTUGAL
In the case of retail and recreation areas, the difference between the three groups is significant [F(2,1576) = 29.72; Finally, when studying the data on presence in residential areas we have seen that there are significant differences between the groups [F(2, 6728) = 343.049; p < 0.05]. However, in all cases the values are higher than the baseline. Post hoc comparisons using the Tukey HSD test indicates that the mean value for group A (M = 7.22, SD = 0.12) is  Table 4 shows the regions included in each group according to the number of inhabitants. Figure 4 captures the percentage that mobility has increased or decreased after the state of alarm in Portugal compared to the baseline and grouped by number of the inhabitants.
In retail and recreation, there are significant differences between the groups [F (2,1909   Group C has lower mobility when compared with the other groups. However, mobility has decreasing when compared with baseline. Finally, when studying the data on presence in residential areas we have seen that there are significant differences between the groups [F(2, 2047) = 747.871; p < 0.05]. However, in all cases the values are higher than the baseline. Post hoc comparisons using the Tukey HSD test indicates that the mean value for group A (M = 3.13, SD = 0.10) is significantly different than the Group B (M = 6.59, SD = 0.13) and Group C (M = 8.96, SD = 0.18). Also Group B and Group C are significantly different. Group C has higher mobility when compared with the other groups.

V. DISCUSSION OF THE RESULTS
When we compare the average ages of the inhabitants of the regions in each group we can observe that minimum average age is lower in Spain but maximum average age is lower in Portugal. With regard to the number of inhabitants in each group of regions, the difference between population density is markedly notorious.
For the analysis of the groups constituted by the average age of the inhabitants in each region, the main conclusions are shown below and also summarized in Table 5: • It is verified that in retail and recreation areas the mobility in Spain is reduced compared to the pre-pandemic period. The difference between the three groups is not significant in Spain. However, in Portugal there are significant differences in mobility, with Group A (younger regions) showing less mobility than the others. In addition, in older regions, mobility through these types of places is higher than before the pandemic; • In groceries and pharmacies, there are significant differences between the groups in Spain and in Portugal. In Spain, Group A, composed by the regions with the lowest mean age, exhibits the lowest mobility in these places, while group C presents the highest. In Portugal, Group A, composed by the regions with the lowest mean age, exhibits high mobility in these places, while group B presents the lowest; • Mobility in the parks is also unequal across regions according to the mean age of their inhabitants, either in Portugal or in Spain. Mobility, in both countries, has increased in all three groups compared to the baseline. In Spain, it is in the more aging regions where there is a higher increase in mobility compared to the prepandemic period. This does not happen in the case of Portugal, where the greatest increase is in regions whose average age is in the middle; • Regarding mobility at transit stations we have found significant differences between the groups and, in all of them, mobility is lower than the baseline in both countries. In Spain, the regions with the highest mean age are those in which there is a lower reduction in the presence at these places. On the contrary, in Portugal the greatest decrease in mobility occurs in regions with a lower average age • There are significant differences in mobility in the workplaces between the groups analysed and mobility is lower than the baseline in both countries. The regions with the lowest average age are the ones where are less transit in these places; • In residential areas we have found significant differences between the groups. However, in both countries and in all groups, mobility values are higher than the baseline. In addition, in both cases, the sharpest decrease is in the less aged regions.
For the analysis of the groups constituted by number of the inhabitants in each region, the main conclusions are shown below and also summarized in Table 6: • In retail and recreations areas, there are no significant differences in mobility between groups in Spain, remaining below the baseline, while in Portugal Group C, composed by the regions with the greater number of inhabitants, exhibits lower mobility in these places (the region of Lisbon and Tagus Valley had exceptional confinement measures during this period.); • In groceries and pharmacies, mobility is higher compared to the baseline in all regions and there are significant differences between the groups in both countries; • Mobility in parks areas has increased in all three groups compared to the baseline, in both countries. Furthermore, we found statistically significant differences in mobility between groups of regions also in both countries; • In transit stations we have found, in both countries, significant differences between groups. We can also VOLUME 10, 2022 observe that, in all regions of Spain, mobility is lower than the baseline while in Portugal it increased in the regions of group A when compared to the baseline.
• In both countries, we found statistically significant differences in workplace mobility between the three groups of regions. However, there was also a decrease in mobility when compared to baseline.
• In residential areas we have found, in both countries, that there are significant differences between the groups of regions and the presence in residential areas has increased.

VI. CONCLUSION
COVID-19 has caused a change in mobility in both Spain and Portugal, which has been maintained even after the end of the restrictions. In both countries we observed less traffic in closed places such as retail and recreation areas and workplaces. Analysis of the data also shows a lower use of public transport. The latter could be a problem if this trend continues in the long term. In both countries, prior to the pandemic, people had been adopting public transport as a means of transportation for commuting to work and school. The fear of possible infection has caused many of them to return to using private vehicles. On the positive side, in both countries there is a higher presence of people in parks. At the beginning of the pandemic, many countries adopted confinement as a measure against COVID-19, which lasted for several months. This had a negative impact on health and increased problems of overweight and obesity. However, with the end of these measures many people have started to practice healthy habits such as running.
As a conclusion, COVID-19 can be an opportunity to replace mobility in cities by making it more pedestrian friendly and promoting measures such as the building of bicycle lanes. Outdoor activities should also be encouraged to avoid negative consequences on the economy. The results obtained in this study are only applicable to the two countries analyzed. As future work it would be interesting to establish a comparison with other countries, as well as to check if the observed trends are maintained once the pandemic is over.
SARA PAIVA (Senior Member, IEEE) received the Ph.D. degree in computer science. She is currently an Assistant Professor with the Polytechnic Institute of Viana do Castelo. She holds a postdoctoral position in advanced driving assistants in Oviedo, Spain. She has authored or coauthored more than 60 scientific publications in journals and conferences. Her research interest includes smart inclusive mobility in smart cities through mobile applied computing. She is also the Vice-Chair of the IEEE Smart Cities Marketing Committee. She is a member of the Editorial Board of the 7.2 IF international journal of Sustainable Cities and Society. She is the General Co-Chair of the EAI International Convention on Smart Cities 360 • since the 2020 edition and is part of the Organizing Committee of IEEE Smart Cities 2021. She has been acting as a Scientific Evaluator of Individual Scientist Project Proposals for Fundamental and Applied Research for the Latvian Council of Science, since 2020. She is the Editor-in-Chief of EAI Endorsed Transaction on Smart Cities and an Associate Editor in several IF journals. She is also the editor of several books with Springer, CRC Press, Cambridge Scholar, and special issues in several impact factor journals. She is a frequent reviewer of international journals and international conferences.
VÍCTOR CORCOBA (Member, IEEE) received the Ph.D. degree from the University Carlos III, Madrid, Spain, and the M.Sc. degree from the University of Granada, Spain. He is currently an Associate Professor with the Computer Science Department, University of Oviedo, Spain. In the past, he was a Postdoctoral Researcher in telematic engineering at the University Carlos III. He is working on wearable devices, stress detection, and intelligent systems for improving driving safety and fuel consumption. He has more than nine years of experience working in research projects related to intelligent transportation systems. He is the author of four books, and more than 40 articles on energy efficiency and safety in vehicles.
FILIPA MOURÃO received the Ph.D. degree in industrial and systems engineering. She is currently an Associate Professor at the Institute Polytechnic of Viana do Castelo. She has authored or coauthored several scientific publications in journals and international conferences. Her main research interests include statistical data analysis and ROC methodology. She is a reviewer of international conferences, such as ICCSA.
XABIEL G. PAÑEDA received the Ph.D. degree from the University of Oviedo, in 2004. He is currently an Associate Professor with the University of Oviedo. He has been working on these topics and others, such as HCI and learning technologies to design advanced driving assistant systems for the last ten years. His main research interests include the Internet of Things and edge computer architectures.
DAVID MELENDI received the Ph.D. degree from the University of Oviedo. He is currently a Computer Science Engineer. He is also an Associate Professor at the University of Oviedo. He is also working on systems for efficient and secure driving in combustion vehicles, edge computer architectures, human-computer interaction devices, and advanced driving assistant systems. His research interests include multimedia systems, human-computer interaction, efficient driving, ad hoc networks, and intelligent transportation systems.
ROBERTO GARCÍA received the Ph.D. degree from the University of Oviedo, Spain, and the M.Sc. degree in telecommunications from the Polytechnical University of Madrid, Spain. He is currently an Associate Professor of telematic engineering with the University of Oviedo. In the past, he was an Associate Professor of electronic technology at the University of Alcala, Spain. He is also working on systems for efficient and secure driving in combustion vehicles, edge computer architectures, human-computer interaction devices, and advanced driving assistant systems. VOLUME 10, 2022