Skip to content

Instantly share code, notes, and snippets.

View lauracodecreations's full-sized avatar

LauraM.dev lauracodecreations

View GitHub Profile
@lauracodecreations
lauracodecreations / index.html
Created November 19, 2018 18:06 — forked from CheezItMan/index.html
My Solution
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title></title>
<link rel = "stylesheet"
type = "text/css"
href = "style.css"
/>
</head>
@lauracodecreations
lauracodecreations / ruby_to_js.js
Created November 16, 2018 23:39
js exercises
// Question 1:
const personAge = 55
const adaAge = 2
// person_age = 55
// ada_age = 2
//
// if person_age < ada_age
// print "This person is younger"
// elsif ada_age < person_age

Creating Histograms with Normal Distribution Line using Python

Problem

You need to know if the data is normally distributed before doing any analysis on it.

Solution

Create histograms for every column and compare it to a normal distribution or bell curve. My code outputs this bell curve on the graph.

Calculating Cronbach's Alpha using Python

Cronbach’s alpha is a measure of internal consistency, that is, how closely related a set of items are as a group. More information about this: https://stats.idre.ucla.edu/spss/faq/what-does-cronbachs-alpha-mean/

The code assumes that you already have uploaded your data in Azure ML, and that you have imported into Python. More information: https://gist.github.com/lauramar17/0fd5ea81be217a7ccd39cacaba7397b9.js

Method: It takes an unlimited number of parameters for the questions that you want to calculate its internal consistency.

To run:

Descriptive Statistics per Column in Azure ML

The Problem

You want to output the descriptive statistics of a column in a dataset, and you want to output the result in an specific format. For example, the name of the 50% index changed to 'median'.

You do not want to install Python in your computer to do this work.

Solution

#!/usr/bin/Rscript
#dti_FA image is in dti.dti directory
#Note: in flsview the slice number is one less than R. If x = 45, then in fslview x = 44
#Note: masks and FA images must be saved in the directory where R started. Use bash script "~/selectracts"
#subject 775353 IFL_R z 26, best(continous), x (non of them are continous)
#y slice sometimes looks a little zquich - size/location of each plot
#the dark color makes it a little slow
library(Rniftilib)
@lauracodecreations
lauracodecreations / README.md
Last active May 10, 2017 01:26
Getting scan date from dicoms (neuroimaging, FMRI, Structural)

Getting Scan Date from Dicoms

The Problem

You get two dicoms files from two different subjects to process, but you accidently rename the wrong one making two different subjects have the same filename. So, to tell them apart you can look into the scan date inside the dicoms file.

Or you accidently lost the information from the scan date, and you need to know when all the subjects in the study were scanned.

Solution