Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assignment5 - Jiaxin Ling #198

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 15 additions & 9 deletions assignment5.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ The data you will be using comes from the Assistments online intelligent tutorin

## Start by uploading the data
```{r}
D1 <-
D1 <- read.csv("Assistments-confidence.csv")

```

Expand All @@ -38,8 +38,9 @@ ggcorr(D1[,-1], method = c("everything", "pearson")) #ggcorr() doesn't have an e
## Create a new data frame with the mean_correct variable removed, we want to keep that variable intact. The other variables will be included in our PCA.

```{r}
D2 <-

library(tidyr)
library(dplyr)
D2 <- select(D1,2:4,6:8)
```

## Now run the PCA on the new data frame
Expand Down Expand Up @@ -72,15 +73,14 @@ plot(pca, type = "lines")

```{r}
#Now, create a data frame of the transformed data from your pca.

D3 <-
D3 <- data.frame(pca$x)

#Attach the variable "mean_correct" from your original data frame to D3.
D3<- mutate(D3, mean_correct=D1$mean_correct)



#Now re-run your correlation plots between the transformed data and mean_correct. If you had dropped some components would you have lost important infomation about mean_correct?

#Now re-run your correlation plots between the transformed data and mean_correct. If you had dropped some components would you have lost important information about mean_correct?
ggcorr(D3, method = c("everything", "pearson"))


```
Expand All @@ -102,10 +102,16 @@ biplot(pca)

```
# Part III
Also in this repository is a data set collected from TC students (tc-program-combos.csv) that shows how many students thought that a TC program was related to andother TC program. Students were shown three program names at a time and were asked which two of the three were most similar. Use PCA to look for components that represent related programs. Explain why you think there are relationships between these programs.
Also in this repository is a data set collected from TC students (tc-program-combos.csv) that shows how many students thought that a TC program was related to another TC program. Students were shown three program names at a time and were asked which two of the three were most similar. Use PCA to look for components that represent related programs. Explain why you think there are relationships between these programs.

```{r}
D4 <- read.csv("tc-program-combos.csv")

D5 <- select(D4, 2:50)

pca2 <- prcomp(D5, scale. = TRUE)

biplot(pca2)
```


Expand Down