Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [sql]

SQL (Structured Query Language) is a special-purpose programming language designed for managing data held in a relational database management system (RDBMS).

1
vote
1answer
12 views

Weekly sales for different start dates automate report

I’m trying to develop a report with customer sales behaviour each time a new product is Launched. The columns in the report would be : sales in time t (the time product was launched ) , sales in time ...
1
vote
0answers
121 views

How to aggregate multiple Z-scores

Is there a way to aggregate multiple Z-scores to get a single Z-score that corresponds to the probability that no null hypotheses are rejected? Backstory: We have a tool that has some error E that ...
1
vote
2answers
1k views

Removing Double quote and adding Single Quote for string in R [closed]

I have a list which has to pass one of it's elements to a SQL Server Query, While in R list elements will be in double quotes, SQL Server will not accept double quotes in a query as pattern. So I need ...
1
vote
1answer
373 views

Comparing distribution of sample proportions to population proportion

I'm trying to find out whether there is a statistical method for comparing a distribution of sample proportions to a distribution of population proportions. For example if I have only two groups, A ...
0
votes
3answers
579 views

how to predict sales of an item changes based on a discount given to another item?

I am developing a system where the management of the supermarket can make decisions on past sales data. There I mainly want to focus on how to predict sales of an item changes based on a discount ...
1
vote
2answers
272 views

Ensemble model of simple univariate linear regression models

Calculating univariate linear regression and correlation is simple in SQL. It can be done like so: ...
1
vote
0answers
135 views

What algorithm could be used to recommend wine given past ratings

Description: given a user's history of 'likes', I would like to predict what product should I recommend to the user, based on past likes (content based). The idea is very similar to Pandora, except ...
0
votes
1answer
308 views

Automating SAS to calculate dates in various formats and store in macro variables

The background is I need to pull data from several sources and put it together, using SQL in SAS. And, I want to automate it as much as possible. So, for one, I want to have a small number of inputs ...
2
votes
0answers
122 views

Calculate value needed to reach target by the end of a year

I have a set of values (scores to a particular KPI), these are reported monthly. I need to calculate what I'd have to score every month from now until the end of the year to reach that target. I'm ...
2
votes
0answers
612 views

How can I (numerically) approximate the quantile in a beta distribution in SQL?

I wrote some code in SAS that among other things, used the BETAINV function (or BETA.INV as it's called in Microsoft Excel) to calculate the quantile in a beta distribution corresponding to a random ...
0
votes
1answer
758 views

How to apply an R prediction model to very big data from SQL database in parallel.

I dont need to load the entire dataset into memory. In fact I only need 1 row at a time to apply a trained model, get the predicted response and put that response somewhere, possibly back into another ...
1
vote
1answer
119 views

Automatically classifying user activity/sessions on a website?

I have a large body of records pertaining to user activity on a website. What I want to do is some sort of classification on each user as they navigate my website. Every algorithm I found so far uses ...
0
votes
1answer
922 views

Difference between prediction in R and SQL

I'm working on a prediction model for a continuous variable (amount of medicine injected) .I use R for modeling.My project flow is to multiply the prediction of a glm (logistic regression) model that ...
1
vote
0answers
1k views

generate frequency distribution from database

In a MySQL database there's a table with a single numeric value column. I want to plot the distribution of these values as a bar chart/histogram with the following ...
0
votes
1answer
665 views

How to translate R to SQL for a Cox Proportional Hazards model?

I have built a cox model in R using the coxph function in the survival package, and now I need to replicate the model in SQL for scoring. From my understanding, the model has the form described on ...
0
votes
1answer
110 views

Freeware similar to MS Access for SQL-less data mining, querying and reporting [closed]

I am looking for freeware similar to MS Access for data mining, querying and reporting without really writing SQL (which I know very well but sometimes I feel lazy and would rather just drag and drop)....
0
votes
1answer
28 views

Dealing with a variable amount of entries for a given attribute

I want to analyze a .csv file with the results of a customer survey. One of the questions is: "Tell us the top 3 reasons you chose us.". The answers are short paragraphs of text listing a ranging ...
2
votes
2answers
2k views

Split dataset randomly

I have a database with 500 records. I want to split these records to 75% and 25% *randomly*in order to use the different datasets for training and testing to machine learning algorithms. Does anyone ...
1
vote
1answer
168 views

When should I update a recommendation engine?

[I asked this on StackOverflow and was told it would be a better fit here] I am including a basic recommendation engine in a very small project for my final exam. I understand the code and the math ...
2
votes
2answers
2k views

Does anybody use star-schema databases to collect and organize their data?

I've been reading about the star schema (or dimensional) database structure, which puts all measurements main in 'facts' table, and all context for those measurements in 'dimension' table linked to ...
1
vote
0answers
101 views

A/B/C testing evaluation over time ans across groups

I'm needing to validate an inherited testing project correct use of confidence testing. Direct mail creatives are being evaluated at month end over a 90 day campaign cycle for several unique customer ...
1
vote
2answers
423 views

Grouping a “other” group with R and ggplot2

I'm trying to figure out, how to best deal with an "other" group or how to create one. I'm using R and ggplot2. Data As an example: I'm analyzing the german Bundestagswahl (general election, every ...
1
vote
1answer
1k views

How can I determine which columns best correlate with target column in a SQL Server Table?

I have a table with a couple hundred columns and a few hundred thousand rows and want to determine which combination of 5-10 columns best correlate with a target column. I have SQL Server and Excel ...
15
votes
2answers
73k views

Calculating the 95th percentile: Comparing normal distribution, R Quantile, and Excel approaches

I was trying to compute the 95th percentile on the following dataset. I came across a few online references of doing it. Approach 1: Based on sample data The first one tells me to obtain the ...
4
votes
2answers
2k views

Conducting correlation and one way ANOVA using data from a PostgreSQL database

I am trying to discern the best way to calculate a correlation and perform a one-way ANOVA on data I am taking from a PostgreSQL database. What tools should I use? Can I do this using the SQL ...
7
votes
8answers
176k views

How do I group a list of numeric values into ranges?

I do have a big list of numeric values (including duplicates) and I do want to group them into ranges in order to see if how do they distribute. Let's say there are 1000 values ranging from 0 to 2....