Why You don't generate those records in SQL Server. Here is a script to generate table with 1000000 rows: DECLARE @values TABLE (DataValue int, RandValue INT) ;WITH mycte AS ( SELECT 1 DataValue UNION all SELECT DataValue + 1 FROM mycte WHERE DataValue + 1 <= 1000000 ) INSERT INTO...

rest,mule,sandbox,mailchimp,dummy-data

MailChimp doesn't currently provide a 'sandbox' account for API testing. I think your best bet would be to subscribe yourself and play around. I've found MailChimp's API to be super easy to use and mighty well documented, so I imagine you won't have too much trouble figuring it out without...

Conversion to factor (the first line) is not necessary, however, factor is a suitable data structure for responses. The only thing left to do is to aggregate positive scores, and to use geom_bar with stat=identity. new[] <- lapply(new, function(x) factor(x, levels = c('yes', 'no'))) yes_plot <- data.frame(question=colnames(new), yes=sapply(new, function(x) sum(x...

r,events,panel,time-series,dummy-data

Here is a solution using the rolling join feature in data.table. I have slightly changed (fixed?) your definition of a and removed the Event column in b1. require(data.table) Start.Year <- c(1990, 1992, 1997, 1995) End.Year <- c(1995, 1993, 2000, 1996) Country <- c("A", "B", "A", "C") a <- data.frame(Start.Year, End.Year,...

I kind of do the same with you. I want to feel in control so whenever I have time I design the dummies myself with the following: d = data.frame( Temperature = c(rep("Cool", 6), rep("Warm", 6)), Bact = c(rep("Bact 1", 2), rep("Bact 2", 2), rep("Bact 3", 2), rep("Bact 1", 2),...

Check the return value of sscanf call, as the document ion states an integer value would be returned. int sscanf( const char *buffer, const char *format, ... ); (C99) I tried out a small piece of code in my machine similar to your query, and indeed sscanf returns negative values...

You could try: library(tm) myCorpus <- Corpus(VectorSource(dumcol)) myTDM <- TermDocumentMatrix(myCorpus, control = list(minWordLength = 1)) as.matrix(myTDM) Which gives: # Docs #Terms 1 2 3 4 # good 1 1 1 0 # hello 0 0 0 1 # moon 1 0 0 1 # morning 0 0 1 0 #...

Let us look at this line by line. local var year You defined a local macro var with content "year". This is legal but you never refer to that local macro in this code, so the definition is pointless. local j = 1996 You defined a local macro j with...

Assuming that you wanted to check whether a subset of "countrycodes" are there in each of the "country" variables with the condition that if atleast one of the "countrycode" is present in a particular row, that row will get "1", or else "0". The idea is to create a vector...

r,loops,regression,lag,dummy-data

Maybe this can help #store your model model<-your_model #get the last pt observation last<-dato[nrows(dato$pt), c('pt', 'age')] years<-12/4 #create dummy t1<-rep(c(1,0,0,0) , years) t2<-rep(c(0,1,0,0) , years) t3<-rep(c(0,0,1,0) , years) t4<-rep(c(0,0,0,1) , years) #create pt observation pt<-c(last$pt, rep(NA, length(t1)-1 )) df<-data.frame(t1=t1,t2=t2,t3=t3,t4=t4,lag_pt=pt, age=last$age) df$predict<-NA for (i in 1:nrow(df) ) { df$predict[i]<-predict(model, data=df[i,]) if...

r,sparse-matrix,dummy-data,glmnet,lasso

I don't think you need a sparse.model.matrix, as all that it really gives you above a regular matrix is expansion of factor terms, and if you're binary already that won't give you anything. You certainly don't need to code as factors, I frequently use glmnet on a regular (non-model) sparse...