Forum Replies Created
-
AuthorPosts
-
Dmitri AdlerParticipant
Hello,
Yes, even if you have a good correlation, you should still test for autocorrelation and outliers. You want to make sure that you either didn’t find a spurious [false] correlation or that your correlation wouldn’t be even stronger without outliers or without autocorrelation. I always perform these 2 checks when I run regression analyses (as well as a few of the other ones you saw in the course).
From what I’ve seen in practice, assuming that good results are necessarily right is a frequent pitfall of even experienced data scientists.
I hope this helps!
-Dmitri
Dmitri AdlerParticipantHi Leemor, please try the code below. Let me know if you have any follow-up questions.
# Setting up the data:
data_1 = c(“9/1/2015 06:44:49”, “9/2/2014 08:30:21”)
data_2 = c(“A”, “B”)
data_3 = as.data.frame(cbind(data_1, data_2))
View(data_3)# Splitting the first column by the blank space in the middle:
# First, check the structure of your data.
str(data_3)# Second, make sure the column you’d like to split is read as characters.
data_3[,1] = as.character(data_3[,1])# Split the column into 2.
data_4 = strsplit(data_3[, 1], ” “)
View(data_4)# Transpose the data and cast it as a data frame to get the final result in 2 columns.
data_5 = t(as.data.frame(data_4))
View(data_5)Hope this helps!
Dmitri AdlerParticipantThe below commands will also save the last plot you viewed in R:
dev.copy(pdf, “Plot Name.pdf”, width = 10, height = 6)
dev.off()Note that the width and height are in inches when you output a pdf.
hank you for learning with us!
-Dmitri
-
AuthorPosts