---
title: "Midsemester Course Evaluation report for 36-617, Fall 2022"
author: "Brian Junker"
date: "10/21/2022"
output: 
  pdf_document:
    keep_tex: true
    
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)

##    includes:
##      in_header: "fix-tables.tex"

```

On page 3 below is a summary of your ratings for 36-617, and on the succeeding pages are your text comments and questions for me.

I really appreciate how much you wrote about the course!  This is very helpful, not only for future iterations of the course, but also for making decisions about how to pace the second half of the semester, etc.
Here are a few comments and reactions to things that caught my eye in your ratings, comments and questions:

\textbf{Ratings}

\begin{itemize}

\item I'm pleased to see that the most frequent category is the middle category for ``Understanding'', ``Difficulty'' and ''Pace'', and especially pleased that for ``Interest'' the next higher category was most frequently endorsed!

\item Trouble spots:
\begin{itemize}
\item About 1/3 of the class think the course is a bit too hard; a few more feel the course is way too hard.
\item A slightly larger fraction think the course is going a bit too fast; a few more feel the course is way too fast.
\end{itemize}
These are related of course: the material feels hard in part because we are going fast.  But there is a bit more going on\ldots

So far in the course, on the technical side I have essentially been reviewing material that you would have seen in a good undergraduate regression course (not all of you saw that material so this is also a good way to get everyone ``on the same page'').  Since there is more new material in the second half of the course, the pace will slow somewhat.  It may still feel challenging to keep up, so here is a little perspective that may help: I am exposing you to lots of ideas and concepts each week.  I do not expect that you will master everything each week, but rather I hope that you are getting enough exposure each week that when you encounter these things in your later professional life you will have some idea what to look for---in textbooks, on the internet, asking colleagues, etc.---to address the data analysis problems that are in front of you.  So do the reading and the exercises with the goal of solidifying that exposure to the main ideas, and to some---but not all---of the technical details.

On the non-technical side, I have been asking you to do a lot of interpretation that some of you may not be used to.  I have also emphasized that there can be several ``good enough'' models, and likely not one single ``best'' model, which many of you are not at all used to!   For me, Statistics is not Computer Science, for which there is often a correct or most efficient algorithm, and it is not Machine Learning, for which prediction or classification is usually the primary goal.  In each of those fields, there is often a deterministically correct or best answer.  Statistics involves the art of using mathematical data analysis to tell important stories about, and/or to get a better understanding of, the data and the mechanisms that give rise to the data.  Statistics also involves grappling with uncertainty, whether that uncertainty is expressed as a confidence interval around a point estimate, or it is expressed in not knowing which is really the ``best'' model, and making do with a model that is ``good enough'' to answer the questions that your client or collaborator may have. After all, \em``All models are wrong but some are useful!" -- G.E.P. Box.\rm

\end{itemize}

\textbf{Your Comments}

\begin{itemize}
\item Nice to see that the zoom recordings are useful!
\item Also good to see that you are getting a lot out of Piazza and office hours.
\item Several of you seem to prefer Wednesday due dates for homework instead of Monday due dates.  I'll ask about that in class.
\item It seems like the homeworks might be a bit long.  Model fitting, data analysis and interpretation are inherently time-consuming processes, but I will try to tighten up the assignments a bit (also this will give you more time to work on the final report project!).  
\item I appreciate the feedback (positive, as well as suggestions for improvement!) on the takehome midterm!
\item There were some comments in the direction of wanting more coding examples in class.  I will try to include coding examples when I can in class, but also please be aware that the hw solutions have complete code to solve the problems, and there are things you can carry forward from old hw solutions to help solve new hw problems.   Also, don't forget that your classmates can be great resources, since I allow (credited!) collaboration on hw's!
\end{itemize}

\textbf{Your Questions \& Things You Learned}

\begin{itemize}
\item Great to see that you are solidifying your knowledge of, and skill in using, linear regression models, diagnostics, methods for model comparison, variable selection, etc.
\item There were some questions about whether we will do any machine learning (ML) in this course, and about what would be expected of you in industry jobs.  
\begin{itemize}
\item There really is no ML in 36-617, but you can get exposure to ML in 36-662 ``Methods of Statistical Learning'' (and probably some in 36-615 ``Software for large-scale data'', 36-616 ``Computational methods for statistics'', and 36-668 ``Text analysis'' as well).  
\item There definitely is a role for linear regression and its siblings (generalized linear models, GAM's, multilevel models, etc.) in industry.  The main advantages of these models is their interpretability, so if you are working with someone who wants to understand and be able to communicate the mechanisms underlying the data you have, these models can be quite useful.  If you are working on a problem where the main concern is good prediction, then methods with more of an ML flavor will generally do better, at the cost of interpretability.  Sometimes your boss or client will want both, of course, and then you have to manage a tradeoff between predictive accuracy and interpretability.  In any case, it is almost always worth trying a linear model or glm first, in part to see if a model with lots of  interpretability will suffice to answer your boss's or client's question, and in part to serve as a ``baseline'' to try to beat with more sophisticated methods that you may be asked to use.
\end{itemize}
\item Some people voiced some rather specific technical questions, that I will not try to answer here.  If you'd like to bring them up on Piazza or in office hours, however, I'd be glad to address them there.

\end{itemize}

\clearpage


```{r echo=F, fig.height=8}
library(stringr)
library(kableExtra)
library(ggplot2); theme_set(theme_bw())
library(gridExtra)

data <- read.csv("eval-data.csv",header=T)

attach(data)

## par(mfrow=c(3,2))

## myplot <- function(x,title=deparse(substitute(x))) {
##     tab <- rep(0,5)
##     names(tab) <- paste(1:5)
##     raw <- table(x)
##     for (i in names(raw)) {
##         tab[i] <- tab[i] + raw[i]
##     }
##     barplot(tab,xlab=title)
## }

myplot <- function(x,title=deparse(substitute(x))) {
  
  x <- sapply(strsplit(x,","),function(x) x[[1]])
  x <- substr(x,1,20)
  
  w <- names(table(x))
  w <- w[order(as.numeric(sapply(strsplit(w,":"),function(x) x[[1]])))]
  
  x <- factor(x,levels=w)
  
  g <- ggplot(data=data,aes(x=x)) 
  
  g <- g + geom_bar() + xlab("") + ggtitle(title) + 
    theme(axis.text.x = element_text(angle = 45,vjust=0.35))
  
  return(g)
}

g1 <- myplot(Understanding,title="My Understanding is ( 1, 2, 3, 4, 5)...")

g2 <- myplot(Interest,"My Interest is ( 1, 2, 3, 4, 5)...")

g3 <- myplot(hard.easy.number,title="The Difficulty is (-2,-1, 0, 1, 2)...")

g4 <- myplot(slow.fast.number,title="The Pace is (-2,-1, 0, 1, 2)...")

## myplot(useful,title="Useful")

grid.arrange(g1,g2,g3,g4,ncol=2)

detach()

```


```{r echo=F}
attach(data)

com_table <- function (x) {

com <- x

for (i in 1:length(com)) {
    loc <- str_locate_all(com[i],"Â")[[1]][,1]
##  loc <- str_locate_all(com[i],"PP ")[[1]][,1]
    if (length(loc)>0) {
        for (j in 1:length(loc)) {
            substr(com[i],loc[j],loc[j]) <- " "
        }
    }
    com[i] <- paste(com[i],"\n\n")
##    com[i] <- paste(com[i],"\n\n---------------------------------------\n\n")
##    if (str_length(com[i])>0) {
##        cat(com[i],"\n\n---------------------------------------\n\n")
##    }
}

set.seed(143256)

com <- com[str_length(com)!=0]
com <- com[!is.na(com)]
com <- com[com!="NA"]
com <- com[com!="N/A"]
com <- com[com!=""]
com <- data.frame(text=sample(com))
n <- dim(com)[1]

return(com)

}


```

\clearpage

```{r echo=F}
x <- com_table(Comments) 

x %>% kbl(col.names="Comments",longtable=TRUE) %>% column_spec(1,width="6in") %>% kable_styling(latex_options = c("hold_position", "repeat_header")) 

```

\clearpage

```{r echo=F}
x <- com_table(Questions) 

x %>% kbl(col.names="Questions",longtable=TRUE) %>% column_spec(1,width="6in") %>% kable_styling(latex_options = c("hold_position", "repeat_header")) 


detach(data)

```

