Skip to main content

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).

Filter by
Sorted by
Tagged with
0 votes
0 answers
8 views

Advice on ideal data structure for storing Long Jsons within SQLite/RDBMS [closed]

I am developing a project that displays a live rendering of bus, when the user clicks on a bus, i would like a linestring representing the bus route to appear/highlight. I am currently attempting to ...
Bispar426's user avatar
0 votes
0 answers
27 views

Predicting Milestones

I have data detailing specific projects going on and when they achieved certain milestones. I'm trying to predict the end date of the project based on these milestone dates. An example of the dates ...
user22484888's user avatar
0 votes
0 answers
23 views

Estimating MAU from a sample

I need to calculate MAU (or just the number of unique users) of a large service, with several conditions. I have a huge log (100B+ lines) of user actions, so I need to select some lines (satisfying ...
Tim's user avatar
  • 21
0 votes
0 answers
11 views

Formal terminology: metafeatures then groupby (GROUP BY) operation

In ML training and other analytics I often combine features to produce a 'metafeature' and then perform a 'groupby' (pandas) or 'GROUP BY' (SQL) query. What is the technical term for this operation? ...
M__'s user avatar
  • 113
1 vote
0 answers
27 views

Fundamental question regarding interaction term replacements using SQL [closed]

group by = an sql function that merges all repeating values of each column(regression variable) into a single distinct value. group by can take multiple arguments: group by createdate, ad, campaign ...
rasputin's user avatar
1 vote
0 answers
31 views

What is the best way to measure the relationship between a baseball player's performance and salary (using statistics)?

Good afternoon, In an effort to learn more about statistics and SQL programming and possibly start building a project portfolio for myself, I've taken it upon myself to investigate a particular ...
Froman's user avatar
  • 11
0 votes
1 answer
1k views

Normal Distribution - Implications of negative values

Consider a task, whereby we need to generate a normally distributed data set of 100 numbers. "tableFreq" is being used to hold the "frequency" data. The sum of the frequencies ...
Jurgen Cuschieri's user avatar
0 votes
1 answer
583 views

How to detect outliers in skewed data?

I have a dataset I need to use to predict the probability of conversion based on the number of days an individual has spent using my app. I got a list of historical users and the number of session ...
Andrei Budaes's user avatar
2 votes
1 answer
353 views

Machine Learning with Aggregated Frequency Data as Training

I am trying to build a Deep Learning model in which I have the following structure user feature binary_label 1 100 0 2 200 1 3 140 0 ... ... ... 6000000 188 1 But the problem is that when I try ...
Andrei Budaes's user avatar
1 vote
1 answer
343 views

Approximate binomial dist in sql

What is the best way of approximating a binomial distribution, given I have the following functions available: normal_cdf ...
PalimPalim's user avatar
0 votes
0 answers
399 views

How does LOESS work in STL Decomposition Algorithm?

I am trying to write a SQL program to calculate STL Decomposition of monthly time series data. In going through the algorithm in the original paper, inner loop step 2 has the detrended series grouped ...
SPJ's user avatar
  • 23
1 vote
0 answers
384 views

Single SQL query for case-control matching [closed]

I am running a case-control study for which I wish to choose 5 controls for each case, stratifying by age, sex, and date of measurement. Each case or control has a unique serial number and the ...
barnhillec's user avatar
1 vote
0 answers
55 views

How do we create a query in MS Access that gives us the cumulative difference? [closed]

I tried using this query: Running Total: CDbl(DSum("[Cost_Replacement]","Cost of Replacement","[RR_Pipe_ID]<=" & [RR_Pipe_ID] & "")) This above query ...
Alence Poudel's user avatar
0 votes
1 answer
50 views

SQL over Big data for datascience [closed]

I just started to learn data science, i am not able to decide if i should go with SQL or Big Data, which one would be more helpful for a data scientist. if anyone would help me to understand this then ...
Lijin Durairaj's user avatar
1 vote
1 answer
124 views

Newbie Data Analyst Questions [closed]

I have recently applied to a Job by a startup that wants to higher a data analyst. I have been going through the rounds and it seems like they want to hire me for the position. I have recently ...
Nick's user avatar
  • 123
4 votes
1 answer
95 views

Electoral college simulation using SQL Server

As I'm sure will be apparent to most here, I'm not a statistician or a programmer, but one of my hobbies is politics. I've created a (very simple) USA electoral college simulation, seen below. The ...
user269144's user avatar
0 votes
3 answers
51 views

Guessing the gender of someone submitting a multiple choice questionnaire

If I have 100 people fill out a multiple choice questionnaire (containing 10 questions with 5 answer choices for each question) and the respondent writes their gender on their questionnaire, what is ...
Nick's user avatar
  • 101
1 vote
1 answer
132 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 ...
Mafalda's user avatar
  • 11
1 vote
0 answers
2k 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 ...
Jack's user avatar
  • 133
1 vote
2 answers
4k 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 ...
V L Sudhakar Inampudi's user avatar
2 votes
1 answer
696 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 ...
N. Bool's user avatar
  • 31
1 vote
3 answers
2k 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 ...
user117897's user avatar
2 votes
2 answers
1k 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: ...
Chris's user avatar
  • 1,249
1 vote
0 answers
157 views

What algorithm could be used to recommend wine given past ratings [closed]

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 ...
zeev1079's user avatar
1 vote
1 answer
565 views

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

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 ...
GeoffDS's user avatar
  • 922
2 votes
0 answers
346 views

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

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 ...
Chris Andrews's user avatar
2 votes
0 answers
2k views

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

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 ...
TijlK's user avatar
  • 73
0 votes
1 answer
1k 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 ...
Gene Ekster's user avatar
1 vote
1 answer
236 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 ...
towelyey's user avatar
0 votes
1 answer
1k 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 ...
user49422's user avatar
  • 213
1 vote
0 answers
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 ...
Dónal's user avatar
  • 111
0 votes
1 answer
874 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 ...
Melissa's user avatar
  • 21
0 votes
1 answer
120 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)....
amphibient's user avatar
0 votes
1 answer
42 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 ...
jessems's user avatar
  • 103
2 votes
2 answers
5k 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 ...
user avatar
1 vote
1 answer
397 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 ...
The_Cthulhu_Kid's user avatar
3 votes
2 answers
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 ...
biofreezer's user avatar
1 vote
0 answers
111 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 ...
Thoth's user avatar
  • 11
1 vote
2 answers
958 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, ...
apepper's user avatar
  • 113
1 vote
1 answer
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 ...
Zartog's user avatar
  • 119
18 votes
2 answers
117k 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 ...
Legend's user avatar
  • 4,542
4 votes
2 answers
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 ...
Spencer's user avatar
  • 221
8 votes
8 answers
219k 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....
sorin's user avatar
  • 191