Hi guys :) I have a dataframe a a <- read.dta("imprese.dta") 15867 obs. and 23 varaible I want to make a linear regression on a sample of 300 units how can i do? Thank you -- View this message in context: http://r.789695.n4.nabble.com/Linear-regression-on-dataframe-s-sample-tp4648288.html Sent from the R help mailing list archive at Nabble.com.
I fount out a solution ... check it out random_sample = function (dt, sample_size) { # determine the number of records in the data frame length_dt = length (dt[,1]) # extract the sample dt [sample (1:length_dt, size = sample_size),] } -- View this message in context: http://r.789695.n4.nabble.com/Linear-regression-on-dataframe-s-sample-tp4648288p4648291.html Sent from the R help mailing list archive at Nabble.com.