You are on page 1of 2

ASSIGNMENT-3

NAME-Kartik Soni SECTION-14


UID-21BCS3022 DATE-10/JULY/2022

Ques-1.)What is One-Way ANOVA test? How One-Way ANOVA testworks?


The one-way analysis of variance (ANOVA), also known as one-factor ANOVA, is anextension
of independent two-samples t-test for comparing means in a situation where
therearemorethan twogroups.
In one-way ANOVA, the data is organized into several groups base on one singlegrouping
variable (also called factor variable). This tutorial describes the basic principle oftheone-
wayANOVAtest andprovides practicalanovatestexamples inRsoftware.
HowitWorks:
The one-way ANOVA compares the means between the groups you are interested in
anddetermines whether any of those means are statistically significantly different from
eachother.Specifically, it tests the null hypothesis:

Ques-2.) Explain with example measure of central tendency and measure


ofvariance.
Central tendency is a descriptive summary of a dataset through a single value that reflects
thecentreofthedatadistribution.Centraltendencyperformsthefollowingmeasures:ArithmeticMe
an
Geometric
MeanHarmonic
MeanMode
Median
A measure of variability is a summary statistic that represents the amount of dispersion in
adataset. Following are some of the measures of variability that R offers to
differentiatebetweendata sets:
Variance
Standard
DeviationRange
Mean
DeviationInterquar
tileRange
Ques-3.)WritecommandsinRtopulltweetsfromtwitter,convertunstructuredtweetsto
structured tweetsi.rremovehttp,stop words etc.
StartRanddownloadthe package“rtweet”,whichIwillusetoextract thetweets.

install.packages("rtweet")l
ibrary(rtweet)

Library and Commands Used for Cleaning the

data.library(tidyverse)
clean_tweets <- function(x)
{x%>%
#RemoveURLs
str_remove_all(" ?(f|ht)(tp)(s?)(://)(.*)[.|/](.*)")
%>%# Remove mentions e.g.
"@my_account"str_remove_all("@[[:alnum:]_]{4,}")%>
%
# Remove
hashtagsstr_remove_all("#[[:alnum:]_]+")%>%
# Replace "&" character reference with
"and"str_replace_all("&amp;","and") %>%
# Remove puntucation, using a standard character
classstr_remove_all("[[:punct:]]")%>%
# Remove "RT: " from beginning of
retweetsstr_remove_all("^RT:?") %>%
# Replace any newline characters with a
spacestr_replace_all("\\\n"," ") %>%
# Make everything
lowercasestr_to_lower()%>%
# Remove any trailing whitespace around the
textstr_trim("both")
}
tweets%>%clean_tweets

You might also like