Prepare for your exams

Study with the several resources on Docsity

Earn points to download

Earn points by helping other students or get them with a premium plan

Guidelines and tips

Prepare for your exams

Study with the several resources on Docsity

Earn points to download

Earn points by helping other students or get them with a premium plan

Community

Ask the community

Ask the community for help and clear up your study doubts

University Rankings

Discover the best universities in your country according to Docsity users

Free resources

Our save-the-student-ebooks!

Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors

Lecture and Lab Set on Descriptive Statistics

Typology: Exams

2023/2024

1 / 9

Download Lecture and Lab Set on Descriptive Statistics and more Exams Nursing in PDF only on Docsity! Lecture and Lab Set on Descriptive Statistics What is descriptive statistics, broadly speaking? Why would we want to use descriptive statistics? - correct answer ✔✔- With descriptive statistics, we have a numerical or quantitative summary of the characteristics of a data set. - We want to work with descriptive statistics because a simple summary is more efficient and effective than a large set of values. What are the two main ways we want to summarize data? Describe them. - correct answer ✔✔- Measures of central tendency: the center of a data distribution given a group of data. - Measures of dispersion: measure the spread of a data distribution given a list of data These both are forms of summary. They help us BETTER UNDERSTAND our data from a broad point of view. What is a mode? Describe multimodal, bimodal, etc. - correct answer ✔✔Given a list of data, for any value, if the value occurs most frequently, the value is the mode. >>> Bimodal: two peaks >>> Multimodal: multiple peaks We don't always have a mode! What is the median? How do we go about determining the median? - correct answer ✔✔The median is the middle value from a set of ordered values - it is the VALUE with an EQUAL NUMBER of data above and below it. How do we determine the median? 1. Order data from smallest to largest FIRST. 2. If the number of values (n) is odd, median is the middle number in the list of ordered values. Essentially, it should be at position (n+1)/2. 3. BUT, if the number of values (n) is even, then our median is the average of the middle two values. What is the mean? What is the difference between the sample and population means? - correct answer ✔✔- The mean itself is the sum of the values divided by the number of values. - The sample mean is the mean of observations. It is X BAR. - Population mean is MU. What is weighted mean? What does "weight" mean here? - correct answer ✔✔A weighted mean is a meal where there is some variation in the relational contribution of individual data values to the mean. Ex: GPA. wi is the weight of an observation (let's say a 3-credit class). xi is the value of that observation (like 3.5). So, We must ADD the PRODUCTS of Wi and Xi - not just the SUM of Xi. Then we DIVIDE by the sum of the wis. What is range? - correct answer ✔✔Range is the difference between the largest and smallest values in an interval/ratio set of data. What is quantile deviation? - correct answer ✔✔Quantile means equal portions of a data set. There are several types of quantile: >>> Median: divide data into 2 EQUAL sets. >>> Quartiles: 4 equal sets - 25% >>> Quintiles: 5 equal sets - 20% >>> Percentiles: 100 equal sets - 1% A quantile gives lots of information, including the median. The median is a data value at the middle position. Since the median is a value that to the left side and to the right side we have an equal number of values, then median has 50% of values to the left of it and 50% of values to the right of it. What is cumulative relative frequency? - correct answer ✔✔For each category, we count the RELATIVE frequency of that value and ALL PREVIOUS values. IF THE LAST ONE DOESN'T ADD UP TO 1.0, you've done something WRONG! What do we have to code in when we're dealing with R notebooks? - correct answer ✔✔We must code in chunks. We can add chunks using C+ inserts. What is an expression in R? What happens with stand-alone expressions? - correct answer ✔✔- An expression is composed of numbers, variables, functions, and other objects connected by mathematical operations like PEMDAS. - Stand-alone expressions that AREN'T assigned to a variable are displayed but NOT saved. What is an assignment operator? What does it do? - correct answer ✔✔An assignment operator in R is "<-"! Essentially, it creates or replaces an object. An object can be legit anything in R - a number, a variable, a data frame, a matrix! In R we can use "<-" or "=". Whatever works best. To the left of the operator, we type the name of the object we want to create/replace. Then, to the right, we go ahead and type an expression, object name, function, etc. To see the results, we simply type the variable name. How do we assign a range of numbers to a new variable? - correct answer ✔✔We add a sequence of numbers using the assignment operator and colon. For instance, if we wanted to assign a list of numbers from 1 to 20 to a new variable, we could simply do: x <- 1:20 What are functions in R? - correct answer ✔✔Functions are commands that programmers have written that calculate long expressions in one go. How do we run functions in R? - correct answer ✔✔To run a function, we type the name of the function followed by a set of parentheses. Inside parentheses, we put the object or number that we want to run the function on - essentially, our argument. Our arguments are what we put inside parentheses and they're what tell R how we want to run the function. We can also put the result of the function into an object! What is the basic format of functions? - correct answer ✔✔functionname(argument1, argument2,...) What are vectors? - correct answer ✔✔A vector in R is an ordered collection of numbers, text, or logical symbols. MUST ALL BE THE SAME DATA TYPE!! Vectors are one dimensional. What is the scan() function, and why would we use it? - correct answer ✔✔The scan() function is for when we have a long list of data we want to read in one at a time. To enter the same vector, we simply type scan() and type all of our data - after each data point we hit the return key. To finish the vector, we hit the return key twice. What is a list in R? - correct answer ✔✔A list in R, in contrast with vectors, can be a combination of data types. Lists are objects that include a collection of anything - numbers, text, or symbols. We create a list using some cool syntax: the list() function. With this list() function, we specify values and their associations: mylist <- list(hisname = "Steve", hername = "Sue", hisage = 40, herage = 39) How do we view a list in R? - correct answer ✔✔Using the View() function - importantly, this function has a capital V. We can also use this function with vectors, data frames, and other objects. How do we access parts of a list? - correct answer ✔✔We can access parts of the list using the same syntax that we have in Python. Essentially, the way we do this is using the bracket syntax. The main difference is that R uses indexing that starts at 1. But, we can access the parts of a list using the index number like so: mylist[2] would access the second item in the list. We can also use the $ operator. In R, $ is a shortcut for referencing a part of a dataset. WE MUST WRITE THE ACTUAL NAME OF THE COLUMN HERE THOUGH. mylist$hisage would access the data value at the data column hisage. What is a dataframe, broadly speaking? - correct answer ✔✔- Dataframes, unlike lists and vectors are TWO DIMENSIONAL. If we want many rows and many columns, which kinda resembles a table. - A dataframe is an object made up of other objects, which are typically vectors. How do we go about coding a data frame? - correct answer ✔✔We use data.frame() and pass in vectors. THESE VECTORS MUST HAVE THE SAME NUMBER OF ELEMENTS. We cannot, under any condition, have a data frame with an unequal number of elements in the vectors involved. How do we give the columns of a data frame different names? - correct answer ✔✔We can simply modify the "key=value" pairs that we use when creating/reassigning the data.frame. For instance, if I wanted to give a vector called "x" the name "numbers" and a vector called "y" the name "letters", I could do something like this: xy <- data.frame(numbers=x, letters=y) How do we access individual vectors in a data frame? - correct answer ✔✔We can access the individual vectors in a data frame using two key strategies. Let's say we were working with the following data frame: xy <- data.frame(numbers=x, letters=y) >>> the index number: xy[1] would access the x vector. >>> the "$" symbol: xy$numbers would also access the x vector by its column name. How do we report back individual elements of a dataframe? - correct answer ✔✔We can report back individual elements with dataframes by referencing both the row and column number. The syntax looks something like this:

Copyright © 2024 Ladybird Srl - Via Leonardo da Vinci 16, 10126, Torino, Italy - VAT 10816460017 - All rights reserved