Search results

  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...
  16. M

    Arima dummy regression arimax

    Dear All, Below is t-shirt sales data for 2011 and 2012 from week 14 to 40. DummyDad is father's day, dummyceleb is the celebration week that moves back 1 week for every year(These weeks are outliers among other weeks).The freq is 27 week and the 2012 is not completed yet. Below is all my...
  17. M

    sqldf and filter by date

    Dear All, Below is a bug that I am not able to filter the data by date. What I need to do is assign parameters date and select the store between these dates. I want to do this by sql ,if other ways available please let me know. Thank you. test1 <- data.frame(open_date =...
  18. M

    arima and regression forecast

    Dear All, Below data is T-shirt sale from week 14 to 35 and year 2011 and 2012. I used dummys to indicate special day sales. Week 25 is father's day and week 35 in 2011 and week 34 in 2012 is special day event sales(this moves 1 week backward everyear). I used 2 models . One is auto.arima...
  19. M

    how to reshape the matrix with or without do loop?

    Dear All, I need to reshape below matrix with or without do loop: Below is my question: fd=read.table(header=TRUE, text=" X1 X2 X3 X4 X5 X6 18.25766 123.9019 151.4487 34.1252 196.6713 231.2289 16.89285 121.7344 146.5685 60.4828 299.1966 346.6185...
  20. M

    regression time series

    Dear Members, I need to do time series analysis. I have retail sales data of a retail company since January 2006(every month). I need to forecast 2012. But I have other variables that effect the sales such as number of stores, supply ...It seems time is not only the variable that has impacts...