randomization

package
v0.0.0-...-49e4fd7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 18, 2019 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Range

func Range(vec []float64) float64

Range returns the numerical range of the values in vec.

func Score

func Score(x string, grp int, counts [][]float64, rates []float64, va *Variable) float64

Score calculates the contribution to the overall score if we put a subject with data value `x` into group `grp` for a given variable `va`. `counts` contains the current cell counts for each level x group combination for this variable, `va` contains variable information.

func Serve404

func Serve404(w http.ResponseWriter)

Serve404 is used when the GET/POST method is mismatched to the handler.

func ServeError

func ServeError(ctx context.Context, w http.ResponseWriter, err error)

func StDev

func StDev(vec []float64) float64

StDev returns the standard deviation of the values in vec.

Types

type Comment

type Comment struct {
	Person   string
	DateTime time.Time
	Date     string
	Time     string
	Comment  []string
}

Comment stores a single comment.

type DataRecord

type DataRecord struct {
	SubjectId     string
	AssignedTime  time.Time
	AssignedGroup string
	CurrentGroup  string
	Included      bool
	Data          []string
	Assigner      string
}

DataRecord stores one record of raw data.

type EncodedProject

type EncodedProject struct {
	Owner           string
	Created         time.Time
	Name            string
	GroupNames      []byte
	Variables       []byte
	Assignments     []int
	Data            []byte
	Bias            int
	Comments        []byte
	Modified        time.Time
	StoreRawData    bool
	RawData         []byte
	NumAssignments  int
	RemovedSubjects []string
	Open            bool
	SamplingRates   []float64
}

EncodedProject is a version of Project that can be stored in the datastore. Appengine datastore doesn't handle structs containing slices of other structs.

type EncodedProjectView

type EncodedProjectView struct {
	Owner           string
	CreatedDate     string
	CreatedTime     string
	Name            string
	Key             string
	GroupNames      []string
	Index           int
	Assignments     []int
	Data            []byte
	Bias            int
	Comments        []*Comment
	ModifiedDate    string
	ModifiedTime    string
	ModifiedEver    bool
	StoreRawData    bool
	RawData         []byte
	NumAssignments  int
	RemovedSubjects []string
	Open            bool
	SamplingRates   string
}

type Project

type Project struct {
	// The Google id of the project owner.
	Owner string

	// The date and time that the project was created.
	Created time.Time

	// The name of the project.
	Name string

	// The names of the groups
	GroupNames  []string
	Variables   []Variable
	Assignments []int
	Data        [][][]float64

	// Controls the level of determinism in the group assignments
	Bias     int
	Comments []*Comment

	// The date and time of the last assignment
	Modified time.Time

	// If true, store the individual-level data, otherwise only store aggregates
	StoreRawData bool

	// The individual-level data, if stored
	RawData []*DataRecord

	// The number of subjects who have had assignments made
	NumAssignments int

	RemovedSubjects []string

	// If true, the project is currently open for enrollment
	Open bool

	// The sampling rates for each treatment group.
	SamplingRates []float64
}

Project stores all information about one project.

type ProjectView

type ProjectView struct {
	Owner           string
	CreatedDate     string
	CreatedTime     string
	GroupNames      string
	Name            string
	Variables       []VariableView
	Key             string
	Assignments     []int
	Data            [][][]float64
	Bias            string
	Comments        []*Comment
	ModifiedDate    string
	ModifiedTime    string
	StoreRawData    bool
	RawData         []byte
	NumAssignments  int
	RemovedSubjects []string
	Open            bool
	SamplingRates   string
}

ProjectView is a printable version of Project.

type SharingByProject

type SharingByProject struct {
	ProjectName string
	Users       string
}

SharingByProject is a record of all users who have access to a given project.

type SharingByUser

type SharingByUser struct {
	User     string
	Projects string // Comma separated list of projects
}

SharingByUser is a record of all projects to which the given user has access.

type Variable

type Variable struct {
	Name   string
	Levels []string
	Weight float64
	Func   string
}

Variable contains information about one variable that will be used as part of the treatment assignment.

type VariableView

type VariableView struct {
	Name   string
	Levels string
	Index  int
	Weight string
	Func   string
}

VariableView is a printable version of a variable.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL