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.

Note: this analysis was performed using the open source software R and Rstudio.

mydata <- read.csv("customer_segmentation.csv")
# we read the dataset using the read.csv function. 
# we saved our original data as customer_segmentation.csv
# I suggest that you use the same document name
summary(lm(buy_solar  ~. -ID, data = mydata)) 
## 
## Call:
## lm(formula = buy_solar ~ . - ID, data = mydata)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -1.3275 -0.2455  0.1719  0.4496  0.6241 
## 
## Coefficients: (1 not defined because of singularities)
##                     Estimate Std. Error t value Pr(>|t|)   
## (Intercept)          8.20604    2.17486   3.773  0.00544 **
## other_electric       0.07421    0.19094   0.389  0.70769   
## Hyundai             -0.16674    0.31425  -0.531  0.61011   
## Toyota               0.14751    0.33077   0.446  0.66745   
## Tesla               -0.40455    0.35105  -1.152  0.28243   
## convert_solar       -1.55498    0.44396  -3.503  0.00805 **
## younger_consumers   -0.72646    0.31951  -2.274  0.05259 . 
## middleage_consumers -0.01925    0.33297  -0.058  0.95532   
## older_consumers           NA         NA      NA       NA   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.776 on 8 degrees of freedom
## Multiple R-squared:  0.7456, Adjusted R-squared:  0.523 
## F-statistic: 3.349 on 7 and 8 DF,  p-value: 0.05593
#we use CS_helpful as a dependent variable and all other variables except ID as predictors. 
# think about the dependent variables you will be using. This may require a little bit domain specific knowledge in marketing.