projectid int 1343 1814 2221 2245 2284 2317 2397 2422 2526 2736 city Factor w

Projectid int 1343 1814 2221 2245 2284 2317 2397 2422

This preview shows page 3 - 8 out of 19 pages.

## $ project_id : int 1343 1814 2221 2245 2284 2317 2397 2422 2526 2736 ... ## $ city : Factor w/ 2339 levels "","180 St John's Rd, Litlestown, PA",..: 1803 180 1803 1383 180 429 1477 1966 1118 1422 ... ## $ state : Factor w/ 52 levels "AK","AL","AR",..: 5 5 5 35 5 36 5 5 5 47 ... ## $ goal : int 2670 5000 100000 12000 20000 500 4500 5000 75000 1000 ... ## $ featured : int 1 0 1 1 1 0 0 0 0 0 ... ## $ fb_total_likes : int 3 18 17 198 33 0 49 90 218 82 ... ## $ all_or_nothing : int 0 0 0 0 0 0 0 0 0 0 ... ## $ category : Factor w/ 24 levels "Animals","Art",..: 10 10 10 10 10 10 10 10 23 10 ... ## $ total_pageviews: int 0 0 0 0 0 0 0 0 890 776 ... ## $ unique_visitors: int 0 0 0 0 0 0 0 0 849 776 ... ## $ start_month : int 8 5 9 5 1 4 7 9 2 8 ... ## $ start_dow : Factor w/ 7 levels "Friday","Monday",..: 5 2 5 6 5 5 5 7 5 3 ... ## $ end_month : int 4 7 7 7 8 6 10 11 4 11 ... ## $ end_dow : Factor w/ 7 levels "Friday","Monday",..: 1 1 5 3 7 2 2 7 4 2 ... ## $ prior_campaigns: int 0 0 0 0 0 0 0 0 0 0 ... ## $ num_perks : int 9 7 4 13 17 15 6 7 11 6 ...
Image of page 3
summary (CFunding$pct_raised) ## Min. 1st Qu. Median Mean 3rd Qu. Max. ## 0.00005 0.11000 0.31650 0.52560 0.90190 140.80000 class (CFunding) ## [1] "data.frame" dim (CFunding) ## [1] 13434 18 #Remove unwanted data CFunding$project_id <- NULL CFunding$city <- NULL CFunding$start_dow <- NULL CFunding$end_dow <- NULL CFunding$prior_campaigns <- NULL CFunding$start_dow <- NULL CFunding$end_dow <- NULL names (CFunding) ## [1] "pct_raised" "success" "state" ## [4] "goal" "featured" "fb_total_likes" ## [7] "all_or_nothing" "category" "total_pageviews" ## [10] "unique_visitors" "start_month" "end_month" ## [13] "num_perks" # Q1.VisualizationAnalysis ------------------------------------------------ success.freq <- table (CFunding$success) #1.1 Bar Plot for Success Variable. We will use a bar chart for categorical variables #to draw the bars horizontally # Add title with "main" with "\n" to break line # Add subtitle with "sub", x and y label with xlab and ylab barplot (success.freq[ order (success.freq)], horiz = T, col= "cadetblue2" , border= NA ,
Image of page 4
xlim= c ( 0 , 10500 ), main= "Frequency Distribution of Successful projects" , sub = "in Crowdfunding" , xlab = "Observations" , ylab = "Number of successes" ) #1.2 Plotting a Histogram #Create a subset of the dataframe by eliminating values greater than 100 CFunding.noOutliers <- subset (CFunding, subset = pct_raised<= 100 ) # Add the title "Histogram for Percentage of Target Funds raised" and the x label "Percentage of Target Funds raised" hist (CFunding.noOutliers$pct_raised, col = "mediumpurple" , border= T, xlim = c ( 0 , 30 ), ylim = c ( 1 , 200 ), main= "Histogram for Percentage of Target Funds raised" , xlab= "Percentage of Target Funds raised" )
Image of page 5
#Convert the readings into log values and then plot a histogram of these values pct_raised_log <- log (CFunding.noOutliers$pct_raised) CFunding.noOutliers <- cbind (CFunding.noOutliers,pct_raised_log) hist (CFunding.noOutliers$pct_raised_log, col = "beige" , border= T, xlim = c (- 5 , 5 ), ylim = c ( 1 , 5000 ), main= "Histogram for Percentage of Target Funds raised" , xlab= "Percentage of Target Funds raised" )
Image of page 6
#1.3 FACTORS # Convert categories, states, start_month into factors str (CFunding.noOutliers) ## 'data.frame': 13433 obs. of 14 variables: ## $ pct_raised : num 1.285 0.15 0.105 1.173 0.192 ... ## $ success : int 1 0 0 1 0 1 0 0 0 1 ... ## $ state : Factor w/ 52 levels "AK","AL","AR",..: 5 5 5 35 5 36 5 5 5 47 ... ## $ goal : int 2670 5000 100000 12000 20000 500 4500 5000 75000 1000 ... ## $ featured : int 1 0 1 1 1 0 0 0 0 0 ... ## $ fb_total_likes : int 3 18 17 198 33 0 49 90 218 82 ...
Image of page 7
Image of page 8

You've reached the end of your free preview.

Want to read all 19 pages?

  • Spring '17
  • Na Na Hey Hey Kiss Him Goodbye, Factor w/, Crowdfunding Analysis, all_or_nothing

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

Stuck? We have tutors online 24/7 who can help you get unstuck.
A+ icon
Ask Expert Tutors You can ask You can ask You can ask (will expire )
Answers in as fast as 15 minutes