Sociolinguistics is the study of language in society and how social factors like age, gender, identity and social networks influence linguistic variation and change. It examines language variation at the phonological, grammatical, lexical and discourse levels between different dialects, idiolects and sociolects. Standard languages are often codified through grammar books and dictionaries, while non-standard dialects are also studied. Sociolinguistic data is collected through naturalistic recordings to minimize the observer's paradox. Models analyze how social mobility and geographical factors drive language loyalty and change over time.