Code needed in R language
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Code needed in R language
Hello everyone
I hope that you are fine. Because I am starter, I am facing difficulties in figuring out commands that do the following:
Find the sample mean M and sample standard deviation S
Build the histogram.
Find if the shape of the distribution is close to normal or not.
Add to the histogram plot the line corresponding to the probability density function of the normal distribution using obtained mean and standard deviation.
Set up a 95% CI for the sample mean, using your values of M,S and N
Use the temperature (tempc and tempf) data given in the excel sheet. You can download the excel sheet from following link:
app.box.co m/s/8uw6os46iibmx4n5t21q (remove space between box.co m)
I hope that you are fine. Because I am starter, I am facing difficulties in figuring out commands that do the following:
Find the sample mean M and sample standard deviation S
Build the histogram.
Find if the shape of the distribution is close to normal or not.
Add to the histogram plot the line corresponding to the probability density function of the normal distribution using obtained mean and standard deviation.
Set up a 95% CI for the sample mean, using your values of M,S and N
Use the temperature (tempc and tempf) data given in the excel sheet. You can download the excel sheet from following link:
app.box.co m/s/8uw6os46iibmx4n5t21q (remove space between box.co m)
Re: Code needed in R language
Hi raishikoh,
1. welcome to the forum!
2. I don't have the slightest idea what you are talking about and if this has any relation to Livecode
Best
Klaus
1. welcome to the forum!

2. I don't have the slightest idea what you are talking about and if this has any relation to Livecode

Best
Klaus
-
- Livecode Opensource Backer
- Posts: 10098
- Joined: Fri Feb 19, 2010 10:17 am
Re: Code needed in R language
#raishikoh
I have a feeling that you need to work out the algorithms for those statistical operations:
actually, if you are bit lazy like me, you can probably find them either in a high school Maths textbook
or by looking on the internet.
I remember finding means (that, at least is very easy) and standard deviation (which is not)
about 35 years ago when I was at school.
After all, all you have to do to find the mean is to add up a column of figures and divide the sum by the number of rows in the column.
After that you have to work out how to express those statistical operations in Livecode.
Then you have to work out how to extract values from an Excel spreadsheet.
And' lastly, how to get a bar chart up and running in Livecode.
--------------------------------------------------------------------------------------
The fact that you give a link to your spreadsheet gives me, at least, the impression
that you want somebody else to do the coding for you.
On these Forums and the Use-List you will find lots of people ready to advise you,
help you and so on, but I don't think you should really expect then to do all the code
work.
I have a feeling that you need to work out the algorithms for those statistical operations:
actually, if you are bit lazy like me, you can probably find them either in a high school Maths textbook
or by looking on the internet.
I remember finding means (that, at least is very easy) and standard deviation (which is not)
about 35 years ago when I was at school.
After all, all you have to do to find the mean is to add up a column of figures and divide the sum by the number of rows in the column.
After that you have to work out how to express those statistical operations in Livecode.
Then you have to work out how to extract values from an Excel spreadsheet.
And' lastly, how to get a bar chart up and running in Livecode.
--------------------------------------------------------------------------------------
The fact that you give a link to your spreadsheet gives me, at least, the impression
that you want somebody else to do the coding for you.
On these Forums and the Use-List you will find lots of people ready to advise you,
help you and so on, but I don't think you should really expect then to do all the code
work.
-
- VIP Livecode Opensource Backer
- Posts: 10045
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: Code needed in R language
@raishikoh: If you need this done in R specifically, have you considered posting your question at R-Help?
https://stat.ethz.ch/mailman/listinfo/r-help
https://stat.ethz.ch/mailman/listinfo/r-help
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: Code needed in R language
Given a x collection of data, using R you to obtain a simple mean you digit:
Using livecode you can write your mean function:
And so on for the other functions.
Code: Select all
mean(x)
Code: Select all
function mean data
put 0 into counter
put 0 into total
repeat for each word temp in data
add temp to total
add 1 to counter
end repeat
put total / counter into y
return y
end mean
put "1 2 3 4 5 6 12.3 15" into x
answer mean(x)
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w
Re: Code needed in R language
Or just use the built-in "average" function which does the same thing.MaxV wrote:Given a x collection of data, using R you to obtain a simple mean you digit:Using livecode you can write your mean function:Code: Select all
mean(x)
And so on for the other functions.Code: Select all
function mean data put 0 into counter put 0 into total repeat for each word temp in data add temp to total add 1 to counter end repeat put total / counter into y return y end mean put "1 2 3 4 5 6 12.3 15" into x answer mean(x)

Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com