Recent content by masarimk

  1. M

    R flexdashboard dimple plot legends and labels messes up in the second page

    I was trying to create flexdashboard with dimple plots but in the second page the legends and x and y labels messes up,mixing each other which seems pretty ugly. I can't fix this. Does anybody has an idea? Please help. Thank you. Not: If I fix the second page, same problem occurs in the first...
  2. M

    measuring student proficiency

    Dear All, Below is my question; You are a statistics insctructor and you cover the topic of logistic regression. In order to ensure that your students understand the material , you create a short quiz covering the material from the section. --Among the students who take the quiz, those who...
  3. M

    right join with dplyr make rows columns

    Actully thanks but still getting an error my_output = data1 %>% group_by(ProductCode) %>% mutate(n_promo=n()) %>% right_join(data2) %>% distinct(Productcode, region, Period) %>% spread(Period, promosales, fill=0) Joining, by = "ProductCode" Error in eval_tidy(enquo(var), var_env) ...
  4. M

    right join with dplyr make rows columns

    Actually this throws me an error. Below is my error message. my_output = data1 %>% right_join(data2) %>% distinct(productcode, region, period) %>% spread(period, promosales, fill=0) Joining, by = "ProductCode" Error: `var` must evaluate to a single number...
  5. M

    right join with dplyr make rows columns

    I would like to do right join data1 and data2 by ProductCode and I need to get desired output table below data1=data.frame(ProductCode=c(1,1,1,2,2,3),region=c("A","A","A","B","B","C")) data1 ProductCode region 1 A 1 A 1 A 2 B 2 B 3 C...
  6. M

    how to model the effect of promotion on products and stores and measure the cannibalization impact during promotions

    I would like to model the effect of promotion on products and stores and measure the cannibalization impact during promotions. In data, there are 336 stores and 189 products. It is pretty big data. My sampe data below is only for one store(StoreCode=34) with one product(ProductCode=47)...
  7. M

    Read earthquake dataset into R and map it with animation

    Dear jamesmartinn, When I run the top code, I got error message below. Can you help with that? Thank you. ggmap(map) +geom_point(data = dat,aes(x = "Boylam(E)", y ="Enlem(N)"),size = range ,alpha = .5) Error: Discrete value supplied to continuous scale
  8. M

    Read earthquake dataset into R and map it with animation

    Thank you for your response jamesmartinn. I also would like to plot the map of the earthqakes happened. Below is what I got so far. But my question below: #Loading necessary packages library(rvest) library(ggmap) library(ggplot2) library(dplyr) ##reading data set widths <-...
  9. M

    Read earthquake dataset into R and map it with animation

    Dear All, I would like to read Turkey's eartquake data set into R and then plot with map with the animation according to the date(earlist to soonest ) that earthquake happened. Can you help me please? Below is what I got so far but can't read the data. Thank you. install.packages('XML')...
  10. M

    R markdown embed googlevis plot into wordpress

    Thank you James for your response. I did try to embedd googlevis interactive plot into wordpress website but no luck.
  11. M

    R markdown embed googlevis plot into wordpress

    Dear All, I have two questions. First One: Plot M opens html but do not show any graph. The screen is empty. WHY? library(googleVis) M=gvisMotionChart(Fruits, idvar="Fruit", timevar="Year") plot(M)#the pages open but no graphs shown Second One: I was searching to embed googlevis chart into...
  12. M

    proportional odds assumption in r

    Dear All, I would like to check proportional odds assumption below. I need to graph log((1-S(t))/S(t)) versus log t. I also want to label y axis as log((1-S(t))/S(t)) and x axis as log t. Can anybody help me with below data set? Thank you. data(tongue); attach(tongue)...
  13. M

    Simulation for logistic regression in R

    Dear All, I would like to simulate data for logistic regression and I need to have below variables x1=numeric (mean=25,std=5) x2=numeric (mean=50,std=10) x3=factor variables with 5 levels x4=factor variable with 3 levels x5=factor variable with 2 levels How can I do that? Thank you
  14. M

    Proc Discrim and interpretation

    Dear All, I have to analyze a small data set. 6 variables and 20 observation. I clustered 20 observation into 3 groups and I used Proc Discrim and SAS output 3 functions. Below is the output; Linear Discriminant Function for CLUSTER Variable Label 1...
  15. M

    Survey Design

    Dear All, I would like to design a big survey. The population is around 70 million which is the whole country. The purpose of the design is to ask questions about politics, abortions ... 1)How many people I need to choose? 2)How can I design it so that the sample represents the whole...