]> code.communitydata.science - stats_class_2019.git/blobdiff - problem_sets/week_05/ps5-worked_solution.Rmd
updates after class
[stats_class_2019.git] / problem_sets / week_05 / ps5-worked_solution.Rmd
index 658fded7eec28a8cd198435d57ad4de9d9d84f26..33572bef68fa1a52888d10a789dcbd56f2435d95 100644 (file)
@@ -32,13 +32,13 @@ Given the structure of the full dataset, it's also easy to calculate all of the
 s.means <- tapply(pop$x, pop$group, mean, na.rm=T)
 s.means
 ```
-We will discuss the relationship of the individual group means to population mean in class.
+We will discuss the relationship of the individual group means to population mean in class. Basically, we can think of each group as a sample, so the sample means are the *sampling distribution* of the population mean.
 
 ## PC2  
 
-I'll do this two ways. First, just plugging the values into the formula for the standard error, I can then add/subtract twice the standard from the mean to find the 95% CI.
+I'll do this two ways. First, just plugging the values from the group sample into the formula for the standard error, I can then add/subtract twice the standard from the mean to find the 95% CI.
 ```{r}
-se <- sd(w3$x, na.rm=T) / sqrt(length(w3$x))
+se <- sd(w3$x, na.rm=T) / sqrt(length(w3$x[!is.na(w3$x)]))
 mean(w3$x, na.rm=T)-(2*se)
 mean(w3$x, na.rm=T)+(2*se)
 ```
@@ -66,7 +66,7 @@ group.confints
 ```
 ## PC3  
 
-We'll discuss this one in class.  
+We'll discuss this one in class too. Since the samples are (random) samples, we should not be surprised that their individual group means are different from the population mean. We should also not be surprised that the 95% CI for the population mean estimated from at least one of the samples does *not* include the true population mean. Since our confidence interval is 95%, we would expect to be wrong about 1/20 times on average!
 
 ## PC4  
 
@@ -94,7 +94,7 @@ tapply(pop$x, pop$group, summary)
 
 tapply(pop$x, pop$group, sd, na.rm=T)
 ```
-They all look a little bit different from each other and from the population distribution. We'll discuss these differences in class.  
+They all look a little bit different from each other and from the population distribution. We'll discuss these differences in class. Again, none of this should be shocking given the relationship of the samples to the population.  
 
 ## PC5  
 
@@ -107,7 +107,7 @@ sd(s.means)
 ## My standard error from one of the groups above:
 se
 ```
-We will discuss the relationship of these values in class.  
+We will discuss the relationship of these values in class. As mentioned earlier, the distribution of sample means drawn from the population is the *sampling distribution*. The standard error of the mean estimated from any of the individual groups/samples should be a good approximation of (but not necessarily equal to!) the standard deviation of the sampling distribution of the means. 
 
 ## PC 6  
 
@@ -146,7 +146,7 @@ hist(sapply(rep(1, 100), function (x) { mean(sample(pop.unif, 100))}))
 
 ## PC7  
 
-We'll discuss this in class.
+We'll discuss this in class. Noteable things you might observe include that the sampling distribution of the means approaches normality as it gets larger in size whether the population we draw from is uniform, log-normal, or really just about any other distribution. This is an illustration of some aspects of the *central limit theorem*. It is also an illustration of the *t-distribution* (the basis for the t-tests that you learned about this week).
 
 # Statistical Questions
 
@@ -260,7 +260,7 @@ We'll discuss this one as a group. Personally, I find the focus on p-values some
 
 (d) It is (usually) a bit hard to say much from a null result! See the answer to (c) above.
 
-### EQ5 — RQ5 questions 
+## EQ5 — RQ5 questions 
 
 (a) Again, the units are the 109 respondents and the partitioned (low/high) credibility index serves as the independent (grouping) variable. The crisis index is the dependent variable.  
 
@@ -270,7 +270,7 @@ We'll discuss this one as a group. Personally, I find the focus on p-values some
 
 (d) I find the reported differences compelling, but would like more information in order to determine more specific takeaways. For example, I would like to see descriptive statistics about the various measures to help evaluate whether they meet the assumptions for identifying the ANOVA. Survey indices like this are a bit slippery insofar as they can seem to yield results when the differences are really artifacts of the measurements and how they are coded. I am also a bit concerned that the questions seemed to ask about blog credibility in general rather than the specific credibility of the specific blogs read by the study participants? The presumed relationship between credibility and the assignment to the blogs in question is not confirmed empirically, meaning that the differences in perceptions of organizational crisis might be more related to baseline attitudes than to anything specific about the treatment conditions in the experiment. I would also like to know more about the conditional means and standard errors in order to evaluate whether the pairwise average perceptions of organizational crisis vary across perceived credibility levels.
 
-### EQ6 — RQ6 questions  
+## EQ6 — RQ6 questions  
 
 (a) Analogous to RQ5 except that the (six) different dimensions of relationship management separated into high/low categories served as the independent (grouping) variables in the ANOVA. Perceptions of organizational crisis remained the dependent variable. 
 

Community Data Science Collective || Want to submit a patch?