Categories
Mastering Development

how to summarise multiple logistic regression models in a table?

I have a dataset with age as continuous and as a factor, sex as a factor and 4 groups. logistic_s <- data.frame( ID = c(1:6), Age = c(9, 12, 16, 57, 29, 24), Age1 = factor(c(1, 2, 2, 6, 3, 3)), Sex = factor(c(“F”, “M”, “F”, “M”, “F”, “F”)), N = c(rep(1, 6)), G = […]

Categories
Linux Mastering Development

Replacing comma if found inside double quotations in a CSV file using sed

I have a CSV file which I need to load to a MySQL table. I rely of identifying the columns end by the , character. That’s why it is important that the , does not appear elsewhere other than as a column separator. I found some rows which contains a column with , inside double […]

Categories
Mastering Development

I am trying to categorize obervations with a variety of names by grouping them by new variables

I am new to coding and have been trying to use R to simplify the management of mice for the research lab I work at. To use mtcars as an examples. I want to group different observations in mtcars by new variables. For example, if i wanted to group the cars by country of origin […]

Categories
Linux Mastering Development

How to find a matching value in a file and than replace that value in another file?

I have a space separated file like this:(it has 1775 lines) head output.fam 0 ALIKE_g_1LTX827_BI_SNP_F01_33250.CEL 0 0 0 -9 0 BURRY_g_3KYJ479_BI_SNP_A12_40182.CEL 0 0 0 -9 0 ABAFT_g_4RWG569_BI_SNP_E12_35136.CEL 0 0 0 -9 0 MILLE_g_5AVC089_BI_SNP_F02_35746.CEL 0 0 0 -9 0 PEDAL_g_8WWR250_BI_SNP_B06_37732.CEL 0 0 0 -9 … and a comma separated file phg000008.individualinfo (that has 1838 lines): #Phen_Sample_ID […]

Categories
Mastering Development

How to plot a readable histogram?

I am working with a data frame that has columns containing objects, and some of the objects have missing values annotated with a “?”. I am trying to find the median of the objects in a column by plotting a histogram, then I would like to replace the missing values in that column with the […]

Categories
Mastering Development

Classification accuracy is too low (Word2Vec)

i’m working on an Multi-Label Emotion Classification problem to be solved by word2vec. this is my code that i’ve learned from a couple of tutorials. now the accuracy is very low. about 0.02 which is telling me something is wrong in my code. but i cannot find it. i tried this code for TF-IDF and […]

Categories
Development

How to handle column separator being present in one of the columns without using any in-built library in Python?

I want to read a CSV file in Python3 but cannot use any library due to some constraints. In almost every row, one or more columns contain the commas (“,”) and using row.split(‘,’) is causing issues as the number of columns to get increased. My code is: import csv file_name = “train_1.csv” columns = [ […]

Categories
Development

How do I split a column in R into two columns when I have no delimiter?

I have a dataset called data1 that I need to split the first column into two columns. The issue I’m having is that there is no delimiter between what I need to split and the character lengths are different is many rows. I would like to split it by the date and sex. E.g 12/1/09male […]

Categories
Development

No mapping exists from object type System.Windows.Forms.TextBox to a known managed provider native type

private void button1_Click(object sender, EventArgs e) { SqlConnection cn = new SqlConnection(@”Data Source=(LocalDB)\v11.0;AttachDbFilename=D:\Documents\SystemThesis\Barangay Cedula System\Brgy Cedula System\Database\LoginDB.mdf;Integrated Security=True;Connect Timeout=30″); try { string sql = @”insert into Transaction (Transaction_id, Lastname, Firstname, Middlename, Year, Date_issue, Place_issue, Address, Sex, CitShip, DoB, DoP, TL_Amount) values(@Transaction, @Lastname, @Firstname, @Middlename, @Year, @DI, @PI, @Address, @Sex, @CitShip, @DoB, @DoP, @Amount )”; cn.Open(); […]

Categories
Development

SAS, keeping only columns that contain a certain character

I would like to know is it possible to perform an action that keeps only columns that contain a certain character. For example, lets say that I have columns: name, surname, sex, age. I want to keep only columns that start with letter ‘s’ (surname and sex). How do I do that?