blob: e2abc20a15d2e69839e5b361381181c634e705e3 [file] [log] [blame]
/* ----------------------------------------------------------------------- *//**
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
*//* ----------------------------------------------------------------------- */
-- Test clustered standard errors
DROP TABLE IF EXISTS abalone1;
CREATE TABLE abalone1 (
id integer,
sex text,
length double precision,
diameter double precision,
height double precision,
whole double precision,
shucked double precision,
viscera double precision,
shell double precision,
rings integer
);
INSERT INTO abalone1 VALUES
(1, 'M', 0.45500000000000002, 0.36499999999999999, 0.095000000000000001, 0.51400000000000001, 0.22450000000000001, 0.10100000000000001, 0.14999999999999999, 15),
(4, 'M', 0.44, 0.36499999999999999, 0.125, 0.51600000000000001, 0.2155, 0.114, 0.155, 10),
(3, 'F', 0.53000000000000003, 0.41999999999999998, 0.13500000000000001, 0.67700000000000005, 0.25650000000000001, 0.14149999999999999, 0.20999999999999999, 9),
(2, 'M', 0.34999999999999998, 0.26500000000000001, 0.089999999999999997, 0.22550000000000001, 0.099500000000000005, 0.048500000000000001, 0.070000000000000007, 7),
(5, 'I', 0.33000000000000002, 0.255, 0.080000000000000002, 0.20499999999999999, 0.089499999999999996, 0.0395, 0.055, 7);
drop table if exists temp_out;
drop table if exists temp_out_summary;
select clustered_variance_linregr('abalone1', 'temp_out', 'rings', 'array[1, length]', 'sex');