Publications by Rida Hanif

Document

14.03.2024

R Markdown #Linear Regression: # Linear regression analysis is used to predict the value of a variable based on # the value of another variable. The variable you want to predict is called the # dependent variable. The variable you are using to predict the other variable's # value is called the independent variable. data <- data.frame( Y...

39 sym R (5543 sym/22 pcs) 1 img

Document

04.01.2024

R Markdown This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see http://rmarkdown.rstudio.com. When you click the Knit button a document will be generated that includes both content as well as the output of any embedded R code chunks within...

467 sym R (4364 sym/54 pcs) 1 img

Document

03.01.2024

R Markdown Chapter#1 : Descriptive Statistics and Graphics Import your data into R Here, we’ll use the built-in R data set named iris. # Store the data in the variable my_data my_data <- iris Check your data You can inspect your data using the functions head() and tails(), which will display the first and the last part of the data, respective...

1335 sym R (22597 sym/147 pcs) 3 img

Document

03.01.2024

R Markdown Chapter#1 : Descriptive Statistics and Graphics Import your data into R Here, we’ll use the built-in R data set named iris. # Store the data in the variable my_data my_data <- iris Check your data You can inspect your data using the functions head() and tails(), which will display the first and the last part of the data, respective...

1335 sym R (22597 sym/147 pcs) 3 img

Document

03.01.2024

R Markdown Chapter#1 : Descriptive Statistics and Graphics Import your data into R Here, we’ll use the built-in R data set named iris. # Store the data in the variable my_data my_data <- iris Check your data You can inspect your data using the functions head() and tails(), which will display the first and the last part of the data, respective...

1335 sym R (22597 sym/147 pcs) 3 img

Document

15.11.2023

R Markdown correlation_coefficient<-function(x,y){ square_x<-x^2 square_y<-y^2 n<-length(y) corr_coef<-((n*sum(x*y))-(sum(x)*sum(y)))/(sqrt((n*sum(square_x)-sum(x)^2)*(n*sum(square_y)-sum(y)^2))) return(corr_coef) } X<-c(1,2,3,4,5,6,7,8,9) Y<-c(3,54,5,67,2,5,41,4,7) correlation_coefficient(X,Y) ## [1] -0.2201638 sum_numbers<-function(x,y,z...

20 sym

Document

26.10.2023

R Markdown df_1<-data.frame(names=c("Alina","Sajida","Munazza","Jahanzaib"), age=c(18,21,19,24)) new_df1<-which(df_1$age>20) rows_df1<-df_1[new_df1,] rows_df1 ## names age ## 2 Sajida 21 ## 4 Jahanzaib 24 df2<-data.frame(names=c("Amna","Anooj","Nomi"), age=c(21,19,28)) new_df2<-which(df2$age>20) rows_df2<-df2[new_df2,] rows_df2 #...

24 sym

Document

24.10.2023

R Markdown loading the library and data library(dslabs) data(murders) Question#1: Compute the per 100,000 murder rate for each state and store it in an object called murder_rate. Then use logical operators to create a logical vector named low that tells us which entries of murder_rate are lower than 1. murders_rate <- murders$total / murders$po...

1776 sym R (3458 sym/31 pcs)

Rida_Hanif_DS(5121150)

19.10.2023

R Markdown Exercise : 3.11 Loading Murder Dataset from library ‘dslabs’ library(dslabs) data(murders) Question#1: Use the $ operator to access the population size data and store it as the object pop. Then use the sort function to redefine pop so that it is sorted. Finally, use the [ operator to report the smallest population size. pop<-murd...

2274 sym R (5299 sym/27 pcs)

Assignment_3(5121150)

17.10.2023

R Markdown Q:1 Load the US murders dataset. library(dslabs) data(murders) Use the function str to examine the structure of the murders object. We can see that this object is a data frame with 51 rows and fve columns. Which of the following best describes the variables represented in this data frame? A. The 51 states. B. The murder rates for all...

3012 sym R (4348 sym/50 pcs)